Hello, Im trying To create A code In php That Does the Following:
A. detects visiting users real ip address
B. detects city and country
C. detects browser type and version
D. detects referrer url
E. detects landing page
F. appends this information to a txt file
Im using the following php file hosted in same folder as the txt file, and using
<script src='http://h1.ripway.com/Inny/spy/spy.php'></script>
in my html.
txt file
<html>
<head>
<title>Spy</title>
<body background="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif">
</head>
<body>
<SCRIPT src='http://h1.ripway.com/Inny/spy/pass.js'></SCRIPT>
<center><font color='red'>
<form method="POST" action="http://www.geobytes.com/IpLocator.htm?GetLocation">
<input type="hidden" name="cid" value="0">
<input type="hidden" name="c" value="0">
<input type="hidden" name="Template" value="iplocator.htm">
<h3>IP Address to locate:<input type="text" name="ipaddress" size="15" value=""> <input type="submit" value="Submit">
</h3>
</form>
</center>
php
<html>
<head>
<title>Spy</title>
</head>
<body background="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif">
<center><h2>
<center>
<table border="5" bg color="white">
<tr>
<td><center>
<body>
<?php
$spy = fopen("spy.html" , "a");
$site = $HTTP_REFERER;
$ip = $REMOTE_ADDR;
$browser = $HTTP_USER_AGENT;
$time = date("H:i dS F");
echo "<font color='red'>The site User came from: " . $_SERVER["HTTP_REFERER"] . "<br />";
echo "<font color='blue'>ALL IP ADRESSES, TIME, SITE AND USERS BROWSERS ARE BEING CAPTURED!";
fwrite($spy,"<font color='blue'><<<<<------------BEGIN------------>>>>></font><br />");
fwrite($spy,"<font color='black'>Site user came from: $site <br />");
fwrite($spy,"IP Address: $ip <br />");
fwrite($spy,"Browser: $browser <br />");
fwrite($spy,"Time: $time <br />");
fwrite($spy,"<font color='red'><<<<<------------END------------>>>>></font><p/><p>");
fclose($spy);
?>
</table>
</center></td>
</tr>
</table border>
</body>
</html>
Im getting odd results as all entrys show same ip . please help?
<<<<<------------BEGIN------------>>>>>
Site user came from: http://herproom.5.forumer.com/index.php?
IP Address: 192.168.0.5
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Time: 00:11 26th November
<<<<<------------END------------>>>>>
<<<<<------------BEGIN------------>>>>>
Site user came from: http://herproom.5.forumer.com/index.php?
IP Address: 192.168.0.5
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Time: 00:15 26th November
<<<<<------------END------------>>>>>
<<<<<------------BEGIN------------>>>>>
Site user came from: http://herproom.5.forumer.com/index.php?
IP Address: 192.168.0.5
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Time: 00:17 26th November
<<<<<------------END------------>>>>>
This cant all be same user as Ive been watching. Ip showing for all entries
Full-screenYour IP address is 192.168.0.5
City: Marina Del Rey California
Country: United States
Continent: North America
Time Zone: PST
Please help me do What Im trying to.