I am writing a hit counter plugin for Q2A. I used qa-plugin.php to register a widget module. Here is part of the code:
<?php
$file = fopen('hits.txt','r+') or exit('Unable to open file.');
$current = fgets($file) + 1;
rewind($file);
fwrite($file, $current) or exit('Unable to write to file.');
fclose($file);
echo $current;
?>
I am getting the error "Unable to open file", even though I set the permissons to 777. Any ideas?