I got a code that trackers visitor info (ip,date visited etc) what it is meant to do is paste the info in my .txt file it does that but only places ip of the visitors... heres the php code of the main file (not txt) <?php $dtime = date('F jS Y, h:iA'); $ip = $_SERVER['REMOTE_ADDR']; $host = gethostbyaddr($ip); $agent = $_SERVER['HTTP_USER_AGENT']; $uri = $_SERVER['REQUEST_URI']; $ref = $_SERVER['HTTP_REFERER']; if($dtime == ""){ $dtime = "None Recorded"; } if($ip == ""){ $ip = "None Recorded"; } if($host == ""){ $host = "None Recorded"; } if($agent == ""){ $agent = "None Recorded"; } if($uri == ""){ $uri = "None Recorded"; } if($ref == ""){ $ref = "None Recorded"; } $entry_line = " Date: $dtime IP: $ip Host: $host Browser: $agent URL: $uri Referrer: $ref --------------- "; $fp = fopen("visits.txt", "a"); fputs($fp, $entry_line); fclose($fp); ?> PHP: thanks
Can you be more specific? Does just the IP: $ip show up, or do the other prompts show up also in the text file but with no values to them?
That's weird... I copied and pasted your code and uploaded it to my server. It seems to be working fine. :-/ You can check it out here: www.ryanecasey.com/visit.php5 The visitor file is at www.ryanecasey.com/visits.txt