Please wait... Warning: chmod(): Operation not permitted in /Sites/Tear Gas Media/dopost.php on line 9 This is a test to see if my news include idea actually works. Warning: fopen(news.php): failed to open stream: Permission denied in /Sites/Tear Gas Media/dopost.php on line 9 Warning: fwrite(): supplied argument is not a valid stream resource in /Sites/Tear Gas Media/dopost.php on line 10
I am running Apache on Mac OS X 10.3.9, and safe mode is off.
Here is the code of the page that is supposed to execute the actual posting:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php echo "Please wait..."; $day = getdate(date("U")); $old = file_get_contents("news.php"); chmod("news.php","0777"); echo $old; $file = fopen("news.php","w+"); fwrite($file,"$day[month] $day[mday]" . "\n" . $_POST["subject"] . "\n" . $_POST["news"] . "\n" . $old); ?> </body> </html>
I guess, basically, my question is, why can't I access this file, given that safe mode is off? chmod doesn't want to work, dangitall, and that's causing the other errors.