Sonora Communications, Inc.

  • Increase font size
  • Default font size
  • Decrease font size

Joomla - What Is My IP?

E-mail Print PDF

The Joomla module that shows web visitors their external IP address is called mod_whatismyip.  This module uses a small PHP script named mod_whatismyip.php.

We found this script, unmodified, often yields incorrect results from clients behind NAT.  It includes extra logic that maybe removed to improve results.

Try editing the file mod_whatismyip.php (mod_j15whatismyip.php in Joomla 1.5) after making a backup copy, of course.

Change:

$ip;

if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
else $ip = "UNKNOWN";

to:

$ip = "UNKNOWN";
if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");

Last Updated on Sunday, 28 December 2008 13:31  

Your external IP

You are connecting to this site from: 38.103.63.56

Internet Search

Secure Client Login

Email Address:

Password: