Gameon's Favourite Blogs >>
Anoop : : GameOn BuZZ ||                     || Hari S R : : Tranquility ||                    || ~==[[[ Abhi ]]]==~ : : Cogito Ergo Sum ||                    || Abhilash Sir : : A Leaf out of Life ||

Programming Simplified

A Freelancers Tips and Tricks On Programming With Php , Ajax , CGI -PEARL ,Javascripting , CSS and GM(grease-monkey)..




Visitor Tracker

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.



         

           My Photo

           Gameon


Web This Blog


AddThis Social Bookmark Button

Page copy protected against web site content infringement by Copyscape


XML


Powered by Blogger






© 2007 Programming Simplified | ..:nEo:..
No part of the content or the blog may be reproduced without prior written permission.