I've done a quick search of this forum, but I haven't found a solution that worked.
I'm running PHP 4.x with an Apache web server on Macintosh OS 10.3.9. It's an internal school web server that sits on my desk, so I have complete control over it.
I've hit a wall with a script I'm working on right now. This is not a web page. It's a php application that reads a directory and uses the data it gathers to write a web page that lets students view thumbnails of and vote on other students' graphic or Flash projects.
I've changed the folder and file permissions to 777, but I'm still not able to fwrite to or fclose the text file that I can successfully fopen.
========== This is my code ($poll is defined above as "f1.php")
133 $filename = $poll;
134 $fh = fopen($filename, "a") || die("Could not open $filename\n");
135 fwrite($fh, $pageBody) || die("Could not write to $filename\n");
136 fclose($fh);
========== This is the error message I'm getting
Warning: fwrite(): supplied argument is not a valid stream resource in /Library/WebServer/Documents/evaluations/evalGen.php on line 135
Could not write to f1.php
Does anyone have a clue what's amiss here?