I swear I have all permission set to "write', but I still can't get fwrite() to work!!
I keep getting this error:
Warning: fopen("count.dat", "w") - Permission denied in C:\Inetpub\wwwroot\PHPFiles\hs~hit_counter1.php
this is my code:
<?php
$counter_file = "count.dat";
if(!($fp = fopen($counter_file, "r"))) die ("cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "you are visitor no. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
?>
I have already created the count.dat file.
And I know it opens this file cuz the first half of the code works. It doesn't say "cannot open count.dat", it just says you are 'visitor no 1' and then gives that error message.
can anyone help me please!!
thanks!