How to get the IP address of the visitor with PHP?
- Monday, July 19, 2010, 7:20
- PHP
- Add a comment
|
|
We can get the IP address of any visitor by using PHP. The following code will give the ip address of visitor.
{code codetype=php}
< ?php
$ipadd = $_SERVER['REMOTE_ADDR'];
echo "IP address is ".$ipadd;
?>
{/code}
$_SERVER['REMOTE_ADDR'] will return the remote ipaddress


