You are here

$_SERVER['REMOTE_ADDR'] the client IP address

Many have made very successful sites whose sole purpose is to echo the client IP address. A lot of tech heads have their favorites such as http://ipchicken.com or http://whatismyip.com, to name a couple. This is done simply by writing this script:

<?php echo $_SERVER['REMOTE_ADDR']; ?>

For example, your IP address is:

54.226.173.169

So, if you ever find yourself asking "What is my IP?" or "How can I get the IP of a user accessing my site?" then this is the way to do it in PHP.

IP Addresses that have accessed this site:

IP AddressNumber of visits heresort ascending
37.59.179.232313291
94.23.75.16299156
94.23.75.16299156
113.212.70.24380495
217.195.202.5366088
212.38.176.20851631
216.152.246.5945052
69.26.164.7544826
176.31.14.23243167
113.212.69.18140217
176.31.133.4337113
108.166.200.23127038
66.249.75.926451
216.151.130.18726374
199.59.56.2425100
216.151.130.17923387
66.249.75.5020914
178.32.31.2318903
178.33.217.2617901
66.249.66.5015722
216.152.251.5215617
99.26.127.2915558
37.59.176.22315489
109.200.12.5015419
46.37.173.18014745
192.187.100.15414352
175.142.27.13313515
66.249.73.23213447
80.72.37.15613232
199.91.174.22713144
217.195.202.612987
91.237.249.16812895
69.26.164.6712824
94.23.164.24511883
91.121.243.25111514
184.82.159.17011394
115.133.68.7510679
178.32.31.910668
78.46.133.15810482
216.152.243.14610123
216.152.252.2379856
66.249.75.819697
110.170.25.1829639
173.242.119.79094
88.190.16.368817
37.59.157.578706
5.9.215.478639
178.63.169.948555
72.186.110.1498485
198.167.139.838255

Pages