PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$filename = "counter.txt"; //the name of the text file which stores the info
$handle = fopen($filename, "a+");
$contents = fread($handle, filesize($filename));
my page wrote:Warning: fopen(counter.txt): failed to open stream: Permission denied in /home/des404/public_html/counter.php on line 7
Warning: filesize(): Stat failed for counter.txt (errno=2 - No such file or directory) in /home/des404/public_html/counter.php on line 8
Warning: fread(): supplied argument is not a valid stream resource in /home/des404/public_html/counter.php on line 8
Is there something else I have to do to allow fopen to create the file? I want to keep this script to as simple installation as possible (ie. making them upload 1 file instead of 2 being ideal )