How to get the IP address of the visitor with PHP?

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

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Related Posts

  • No Related Post
Related Posts with Thumbnails

About the Author

CoreTimer

has written 31 stories on this site.

System administrator(Linux/UNIX/Windows) RHCE,MCP,CCNA

Write a Comment

Copyright © 2012 CoreTimer.com|System Admin’s Reference. All rights reserved.

Switch to our mobile site