What is My IP Address?

What is My IP Address?

An Internet Protocol address (IP address) is a numerical label assigned to each device connected to the Internet. The IP Address you are using to access this page is displayed below:

54.91.41.87

If you would like to setup a page similar to this using PHP, feel free to use the code sample below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

if (!empty($_SERVER["HTTP_CLIENT_IP"])) {

// grab the visitors IP address and store it to the IP variable

$ip = $_SERVER["HTTP_CLIENT_IP"]; } elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {

// check for proxy and grab forwarded (real) address
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; }

else { $ip = $_SERVER["REMOTE_ADDR"]; }

// print the IP address to the screen
print $ip;

?>
DIGITAL PCI © 2019