Hey, I've been trying to get this to work for an hour and i just cannot work out whats wrong with my code. I used the same code in a 'mailing list' script and that works fine so i cant make out whats wrong with this one. I am using a flat file that gets 1 added to it everytime someone views the site. Here it is:
$vcountfilename = "VisitorCount.txt";
$vcmyfile = @fopen($vcountfilename, "r") or die("Error opening file");
$vcontents = fread($vcmyfile, filesize($vcountfilename));
fclose($vcmyfile);
$vcontents = ($vcontents + 1);
$vcmyfile = @fopen($vcountfilename, "w") or die("Error opening count file1");
@fwrite($vcmyfile, $vcontents) or die("Error with addition");
fclose($vcmyfile);
BTW, VisitorCount.txt is not empty so that cant be the problem. I am getting the error: "Error opening count file1".
Any1 see a problem with it?
Ask if you have any questions about it.
Thanks,
BIOSTALL