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
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

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 :

   // -->>> 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:
 - please remove the ".nospam" from address.
do you want to know more?
web:    http://www.blichmann.de

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to