MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Sat, Jan 09, 2010 9:09 pm

Checking Client IP address with PHP

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

$FQDN = gethostbyaddr($_SERVER['REMOTE_ADDR']);
print ("<b>IP Address:</b> $IP<br>");
print ("<b>FQDN:</b> $FQDN<br>");


  1. how to get client's IP address in PHP
    Date: August 10, 2006
  2. Predefined Variables
    Last Updated; January 8, 2010
    PHP: Hypertext Preprocessor

[/network/web/browser] permanent link

Once You Know, You Newegg AliExpress by

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo