I noticed that two PHP scripts, BrowserInfo and BrowserTest, that I use to have people provide me with information on their browser, such as the plugins available, were not providing the IP address from which browsers were viewing the scripts, because I hadn't updated them for a long time, but had upgraded PHP on the website quite some time ago. The relevant old code is shown below:
<?php
$IP = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$FQDN = gethostbyaddr($HTTP_SERVER_VARS['REMOTE_ADDR']);
print ("<b>IP Address:</b> $IP<br>");
print ("<b>FQDN:</b> $FQDN<br>");
?>
I had to change the code to that shown below:
<?php
$IP = $_SERVER['REMOTE_ADDR'];
$FQDN = gethostbyaddr($_SERVER['REMOTE_ADDR']);
print ("<b>IP Address:</b> $IP<br>");
print ("<b>FQDN:</b> $FQDN<br>");
?>
References:
-
how to get client's IP address in PHP
Date: August 10, 2006
PHPBuilder.com -
Predefined Variables
Last Updated; January 8, 2010
PHP: Hypertext Preprocessor