Thanks that will do the job. I needed it to make this text counter.
<?
$root = $_SERVER["DOCUMENT_ROOT"];
$counid = $_SERVER["PHP_SELF"];
$counid = str_replace('/', '', $counid);
if(is_dir("$root/counters"))
{
if (is_file("$root/counters/$counid.txt")){
$datei = fopen("$root/counters/$counid.txt","r");
$count = fgets($datei,1000);
fclose($datei);
$count=$count + 1 ;
echo "<font face=Arial, Helvetica size=2>You Are Vistor # $count</font><br>" ;
echo "\n<br>" ;
$datei = fopen("$root/counters/$counid.txt","w");
fwrite($datei, $count);
fclose($datei);
}else{fopen("$root/counters/$counid.txt","w");
header("Location: /$counid");}}
else{mkdir("$root/counters");
header("Location: /$counid");
}
?>
count visits to individual pages keeps all counters in one file.
Thanks,
Eznetlinks