how to find or trace visitor's ip address in php - REMOTE_ADDR server variable to find visitor's ip address
how-to-find-visitor-ip-address-in-php.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>how to find or trace visitor's ip address in php - REMOTE_ADDR server variable to find visitor's ip address</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Md Iqbal Hosan">
<meta name="title" content="how to find or trace visitor's ip address in php - REMOTE_ADDR server variable to find visitor's ip address">
<meta name="keywords" content="php, example, code, array, function, money_format, string, REMOTE_ADDR, server variable, visitor ip address">
<meta name="description" content="how to find or trace visitor's ip address in php - REMOTE_ADDR server variable to find visitor's ip address">
<style>
h2, h4{background:#ddd; color:#000095;}
h2{ padding:3px; margin:3px; font-size:23px;}
h4{ padding:2px; margin:2px; font-size:18px;}
p{padding:2px; margin:2px; color:#0099cc;}
body{ background:#FFFFFd;}
</style>
</head>
<body>
<h2>how to find or trace visitor's ip address in php - REMOTE_ADDR server variable to find visitor's ip address</h2>
<pre>
<?php
/*
---------------------------------------------------------
we want to find visitor's ip address in the site
we can do this by using REMOTE_ADDR server variable in php
---------------------------------------------------------
*/
echo "<h4>output of visitor's ip address by using REMOTE_ADDR server variable</h4>";
echo $_SERVER['REMOTE_ADDR'];
/*
-------------------------------------------------------
since my program is running in the local machine
REMOTE_ADDR server variable shows 127.0.0.1 as localhost
in production server it will show real ip address of visitor.
in professional programming it is used rapidly in various
fields.
for example to trace visitor.
to make the site localize it's used.
-------------------------------------------------------
*/
?>
</pre>
</body>
</html>

Thanks..
ReplyDeleteYou have insert simple code using php how to trach a ip address..
i think its not a complex coding.... it simple in beginner.