Getting user ipaddress in php

by rajesh 2009-10-29 09:46:47

$_SERVER['REMOTE_ADDR']; will get us the ipaddress of the pc or computer that is accessing our page.

Example Code:

$ipaddress = $_SERVER['REMOTE_ADDR'];
echo "The Ip Address is $ipaddress";
?>

Tagged in:

747
like
0
dislike
0
mail
flag

You must LOGIN to add comments