getenv() replacement when running as ISAPI ???

From: Date: Sat, 26 Jan 2002 18:07:35 +0000
Subject: getenv() replacement when running as ISAPI ???
Groups: php.general 
Request: Send a blank email to php-general+get-82230@lists.php.net to get a copy of this message
Hi there! Anybody knows a replacement for the built-in getenv()-function since it's not supported when running as an ISAPI-module under Internet Information Server 5.0 on Windows 2000 Professional (well, at least according to the manual). I've created a small counter that looks up the user's IP in a database in order to prevent duplicate hits when user is reloding the page and to track how many users are "currently online". Suggestions welcome.... BTW, this is the code I'm using now (temporarily running the CGI version): === CUT HERE === // ... // Get user's IP and user agent (-->>> problem arises here <<<--) $ip = ip2long(($tmp = getenv("HTTP_X_FORWARD_FOR")) ? $tmp : getenv("REMOTE_ADDR")); // -->>> and here <<<-- $useragent = getenv("HTTP_USER_AGENT"); // Check if visit already counted $id = 0; $counted = false; $r = mysql_query("SELECT visitor.id, visitor.ip, visitor.useragent, visits.timestamp FROM visitor, visits WHERE visitor.id = visits.visitor_id ORDER BY visitor.id DESC"); // ... === CUT HERE === Christian Blichmann _____________________________________________ don't hesitate - email me with your thoughts: e-mail: feedback.nospam@blichmann.de - please remove the ".nospam" from address. _____________________________________________ do you want to know more? web: http://www.blichmann.de

« previous php.general (#82230) next »