see that
save this code counter.php
<?php
$myfile = "php.txt";
// file exists php.txt
if(file_exists($myfile))//if the file exists
{ //we run our counter script
$var = @fopen( $myfile,'r+');
$visits = @fread($var,filesize($myfile));
rewind( $var );
$visits++; // +1
@fwrite($var, $visits);
fclose($var);//closes our file reference
}
else
{
print " i can not found $myfile ... i make ok ..";
$r = @fopen( $myfile,"w");
$w = @fwrite($r, '0');
fclose($r);
Die();
}
$message = sprintf("%s Guast Of 1/9/2005.",$visits);
print $message;
?>
use
<?
include "counter.php";
?>
you not need create php.txt ... the counter.php has make 🙂
but you need "chmod" to php.txt when he Don't work..