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:
$file = fopen('hits.txt','r+') or exit('Unable to open file.');
$current = fgets($file) + 1;
fwrite($file, $current) or exit('Unable to write to file.');
I am getting the error "Unable to open file", even though I set the permissons to 777. Any ideas?