CODE:<?
$file="count.txt";
$cy = date("Y");//текущий год
$cm = date("n");//месяц
$cd = date("j");//день
$newfile = fopen($file,"r");
list($num,$fy,$fm,$fd) = fscanf($newfile, "%d:%d/%d/%d");
fclose($newfile);
if ($fy!=$cy || $fm!=$cm || $fd!=$cd)
$num = 1;
else
$num++;
$newfile = fopen($file,"w");
fwrite($newfile, "$num:$cy/$cm/$cd");
fclose($newfile);
echo "document.write('$num');";
?> |