REMOTE_ADDR probs
| From: | cyberskydive | Date: | Mon, 11 Feb 2002 15:41:34 +0000 |
| Subject: | REMOTE_ADDR probs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84286@lists.php.net to get a copy of this message | ||
I have a wird probelm. The server is on solaris php 4.06
I have a variable thats simply
$user = getenv('REMOTE_ADDR');
this returns the users Ip address, which is logged, and works properly.
On another page before the IP is actually logged (if its not found)
I have the same value for $user
I use the method below to search the log file for the users IP and display
the appropriate content.
It works great on windows running apache php 4.0.1
but on solaris php 4.06 if I add a
print($first);
it returns the servers IP address, but everywhere else it returns the users
IP address.
Whats goin on here?
<?
$search = fopen($log_file, 'r+');
$first = $user;
$second = fgets($search, 1024);
if(strstr($second, "$first") != "")
{
print("<b>It seems you have already taken the survey.</b><br>");
print('You will not be able to take the survey twice.<br>');
print('Please check back later!');
}
else
{
print("<a href=\"/survey/1/index.php\"
onclick=\"NewWindow(this.href,'name','503','181','no');return
false\">Take
the Survey!</a>");
}
?>