How does "What is my IP" work?

When you browse to a webpage, your computer tells the webpage server what your IP address is so the server can send you the HTML, graphics, and other elements of the webpage. The "What is my IP" page takes this information and displays it to you.

Our website uses PHP, a dynamic scripting language that powers thousands of websites across the internet. In PHP you can get the visitor's IP address with this snippet of code:

/* This code is public domain */
/* Source: http://ipaddr.es */

// Save the IP to a variable
$ip_address = $_SERVER['REMOTE_ADDR'];

// To display the IP:
echo $ip_address;

Last updated: December 20, 2014 (3:55 PM GMT)