January 24, 2010

Detect a User's IP Address

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

-----------------------------------------------------------------------------------
This code to detect a user's IP address. This can help you specialize the site's content for your users, or redirect them based on location. You can also use a person's IP address as a security measure to make sure it is actually them logging into their account.
-------------------------------------------------------------------------------------

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Followers