Change the file location to.
Code:
$COUNTER_FILE = getcwd()."/scripts/hitcounter.dat";
That should work.
also you don't need to read that many bytes from the file, do like 128 or something. I highly doubt you will get that many hits
Also the reason for the error is that you including the file into your index this means that the current dir is not right, so you need to add the dir to the file including the scripts folder. What your script is doing is trying to open a file in the dir that you index file is in and not the dir the counter fil is in.
enjoy, ELchupathingy