Tuesday, July 10, 2012

How To find out Visitors IP ADDRESS using PHP

 IP ADDRESS using PHPI f you a PHP programmer then you will find it very easy to track your visitors IP Address, if someone spaming on your site you can also block him. PHP is alway easy and powerful than other scripting language lets check the whole code .



Codding:

<!DOCTYPE html>
<html lang="en">
<head>
<title>IP Address</title>
<meta charset="utf-8" />
</head>
<body>
<?php
$ip=$_SERVER['REMOTE_ADDR'];
echo "<br/>Your IP Address is ".$ip;
// suppose IP 127.0.0.1 for localhost and it redirects to prevent spam
if($ip=='127.0.0.1')
{
echo "You are blocked for Spaming";
header("refresh:5; http://www.openplus.in");
}
?>
</body>
</html>




PickMe
Delicious Save this on Delicious

No comments :

Post a Comment

If you have any Question , Suggestion or idea then please comment regarding the post.