Access Log - Keeps track of any page, just add the code to the bottom of the page. |
<?
// Begin Access Log
// == This Script Free To Use Providing This Notice Remains ==
// == This Script Has Been Found In The http://snapbuilder.com Free Public Codes Library ==
// == NOTICE: Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply ==
// Place code at bottom of the page.
$ip = getenv("REMOTE_ADDR");
$date = date("D, M n, h:ia");
$txtlog = "./log.txt"; // be sure to create a blank log.txt file
$page = $_SERVER[PHP_SELF];
$fp = @fopen($txtlog, "r+") or die("Error occured while opening file.");
$filedata = fread($fp, filesize($txtlog));
$mystr = "$ip - $date - $page
$filedata"
;
rewind($fp);
fwrite($fp, $mystr);
fclose($fp);
?>
// NOTE:
// Be sure to create a blank log.txt file for the access logs to be stored
// You can create different log.txt files for pages... just rename $txtlog = "./log.txt"; // to log1.txt... etc.
|
Scroll