Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

How To find out Visitors IP ADDRESS using PHP

How To find out Visitors IP ADDRESS using PHP

I 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> 

 

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments