Visitor Tracker
Published by Unknown on Monday, July 30, 2007 at 10:29 PM.
This is a Simple script to log visitors of your site.
[code start]
//User Tracker
//Check refered page
if (!$_SERVER['HTTP_REFERER']) {
$ref = 'None';
} else {
$ref = $_SERVER['HTTP_REFERER'];
}
$date = date('d/m/Y H:i:s');
$ip = $_SERVER['REMOTE_ADDR'];
$data = 'IP Address: '. $ip. ' - ';
$data .= 'Date: '. $date. ' - ';
$data .= 'Referer: '. $ref. "\n";
// Write information to a log file, Append mode.
// Pointer placed below the record.
file_put_contents('./track.log', $data, FILE_APPEND)
or die ('Oopsy error on writing... You may go this time... Sorry :)');
?>
[code end]
how to use>>
Just copy it to your homepage then overwrite your homepage in your server.
This code records visit time, and Referrers to a text file.
[code start]
//User Tracker
//Check refered page
if (!$_SERVER['HTTP_REFERER']) {
$ref = 'None';
} else {
$ref = $_SERVER['HTTP_REFERER'];
}
$date = date('d/m/Y H:i:s');
$ip = $_SERVER['REMOTE_ADDR'];
$data = 'IP Address: '. $ip. ' - ';
$data .= 'Date: '. $date. ' - ';
$data .= 'Referer: '. $ref. "\n";
// Write information to a log file, Append mode.
// Pointer placed below the record.
file_put_contents('./track.log', $data, FILE_APPEND)
or die ('Oopsy error on writing... You may go this time... Sorry :)');
?>
[code end]
how to use>>
Just copy it to your homepage then overwrite your homepage in your server.
This code records visit time, and Referrers to a text file.