//counter routine
?>
New Document
Thanks for visiting!";
/*
**********************************************************
* *
* Bala's Simple PHP Counter *
*Copyright (c) 1999, Balakumar (somu_balakumar@yahoo.com *
* *
**********************************************************
*
*
*
* This is a very simple counter I have written using
*PHP. This counter can give you the count of visitors to your
*site. As databases are not used, it is very simple to configure
*and use. You can feel free to copy and distribute.
*
* I welcome your sugesstions and comments. Please mail
*me at somu_balakumar@123india.com.
*
*********************************************************
*/
//open the file handler
//$fp=fopen("visit.txt","r");
$fp=fopen("$visit","r");
//Read the previous count
$count=fgets($fp,1024);
//close the file.
fclose($fp);
//$fw=fopen("visit.txt","w");
$fw=fopen("$visit","w");
//Increment the counter
$cnew=$count+1;
//write the counter back to the log file ie., visit.txt
$countnew=fputs($fw,$count+1);
// Display VISITOR NUMBER
echo "
You are visitor number $cnew since $month
";
fclose($fw);
?>