fopen permission denied
I am adding a hit counter to a site.
I can read to the count.txt file but cannot write to the file to increment the total.
I get a message.
Warning: fopen(./count.txt): failed to open stream: Permission denied in c:\inetpub\wwwroot\pam\index_working.php on line 90
Warning: fwrite(): supplied argument is not a valid stream resource in c:\inetpub\wwwroot\pam\index_working.php on line 91
Warning: fclose(): supplied argument is not a valid stream resource in c:\inetpub\wwwroot\pam\index_working.php on line 92
Your are visitor:31
I am using windows xp pro IIC
I have checked the internet and have so far found others with this problem but so far no fix.
Any ideas??
The code is below
<?php
$a = fopen ("./count.txt", "r");
$bytes = 4;
$x = fread($a, $bytes);
$y=$x + 1;
$fp = fopen ("./count.txt", "w");
fwrite ($fp, "$y");
fclose ($fp);
echo "Your are visitor:$y";
?>
|