How to Get User IP Address using php script

Sunday, July 3, 2011 0 comments
We can get the IP address of any visitor by using PHP.It is very easy to get user IP address using php script.We can store IP address of our visitors for security reason.Similarly, based on the IP address we can also redirect the browser to different areas of the site.


Here's the code:


<?php 
$ip=$_SERVER['REMOTE_ADDR'];
echo "Your ip is : $ip";
?>



That's all.Share your scripts with us in the comments!
Sharing is sexy

Related posts

0 comments for this post

Leave a reply

Leave a Comment
Required fields are marked *