Place your call in the top of the body tags
to run the script "visitors.php3"
...and it will automatically start...
Place your call everywhere in the body tags
to read your 'visitors.txt' file (if needed)
on a new page
...Collected infos
Free Php3/JavaScript provided by ©2003-VB'Breizh
WebSite
==============================================
@@@@@@@ php3 file (visitors.php3) @@@@@@@
==============================================
//###############################
//
// Visitors/Infos (Php3) Version 1.0
// Copyright©2003-VB'Breizh
// web site : http://gilles.saunier.free.fr
// mail to : gilles.saunier@free.fr
//Vous pouvez exploiter librement ce script et le perfectionner
//Si vous y apportez des améliorations notables,
//ayez la gentillesse de m'en faire part...
//
//###############################
//Infos (global variables) :
//$DOCUMENT_ROOT Server roots/ Racine du serveur
//$HTTP_ACCEPT_LANGUAGE Navigator accepted languages/ Langages acceptés //par le navigateur
//$HTTP_HOST Server domain name/ Nom de domaine du serveur
//$HTTP_USER_AGENT Browser type/ Type de navigateur
//$PATH_INFO Script web path/ Chemin web du script
//$PATH_TRANSLATED Script path/ Chemin complet du script //$QUERY_STRING Script parameters/ Paramètres du script
//$REQUEST_METHOD Call method/ Méthode d'appel du script
//$REQUEST_URI Script path/ Chemin du script
//$REMOTE_ADDR IP address/ Adresse IP du client
//$REMOTE_PORT Port of the HTTP request/ Port de la requête HTTP
//$SERVER_ADDR IP server address/ Adresse IP du serveur
//$SERVER_ADMIN Server admin address/ Adresse de l'administrateur du serveur
//$SERVER_NAME Server localhost name/ Nom local du serveur
//$SERVER_SIGNATURE Server type/ Type de serveur
//###############################
// Php3 script - Installation
// php3-module needed on your provider server
// consult your provider documentation
// call to visitors.php3 must be inserted in the body tags
// of your html file. (look at 'visitors.html' code)
//
//###############################
//............infos selected and call to global variables...............
$dateday = Date("d-m");
$language = getenv("HTTP_ACCEPT_LANGUAGE");
$ip = getenv("REMOTE_ADDR");
$datevisit = Date("H:i:s");
$visit =$dateday."\t".$language."\t".$ip."\t".$datevisit."\n";
//...........................frequency.....................................................format : Y m d
//.................................................................................................sample : 2003 12 09
//create one file a month if it does'nt exist //each month
$file= Date("my").".txt"; //return 0312.txt
//........................................................................................
//create one file a week if it does'nt exist //each week
//$file= Date("Y").Date("W").".txt"; //return 200350.txt
//create one file a day if it does'nt exist //each day
//$file= Date("ymd").".txt"; //return 031209.txt
//........................................................................................
$fp = fopen($file,"a+");
fputs($fp, $visit);
fclose($fp);
?>
==============================================
@@@@@@@ php3 file (infos.php3) @@@@@@@
==============================================
//-------Headers/desactivate cache-----------------
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Pragma: no-cache");
//--------------------------------------------------------------
$file= Date("my").".txt"; // last file
if(file_exists("$file")) { // search for this file
$fp=fopen($file,"r"); // open file
$infos = fread($fp,filesize($file)); // read whole file
fclose($fp); // close
echo ($infos); // send infos
}
?>