User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,629 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,595 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Detect User Details?

Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Detect User Details?

  #1  
Nov 26th, 2007
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.
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 12:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC