xItalia Posted May 10, 2007 Share Posted May 10, 2007 Ok so I am making this really simple code basically for a news system without using mysql. I found the tutorial or whatever on how to make most recent posts appear on the top of the page but i keep getting errors. Mabye someone can see the problem? This is coming from another file with the form. $name = $_POST['name']; $news = $_POST['news']; $file = "news.php"; $date = date("F j"); $handle = fopen($file,'r'); $old_news = fread($handle, filesize ($file)); fclose($handle); $info = "<font color=white> $news </font><br><hr color=323232><br><font color=white>Posted by $name , $date </font><br>$old_news<br>"; $handle2 = fopen($file, "w"); $write = fwrite($handle2, $info); fclose($handle2); I just keep getting errors on the last 3 lines of code. For some reason if i just delete them it all works. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/50736-new-looking-for-help/ Share on other sites More sharing options...
trq Posted May 10, 2007 Share Posted May 10, 2007 I just keep getting errors What would they be? Quote Link to comment https://forums.phpfreaks.com/topic/50736-new-looking-for-help/#findComment-249451 Share on other sites More sharing options...
xItalia Posted May 10, 2007 Author Share Posted May 10, 2007 Warning: fopen(news.php) [function.fopen]: failed to open stream: Permission denied in D:\inetpub\vhosts\inthegames.net\httpdocs\newsthanks.php on line 13 Warning: fwrite(): supplied argument is not a valid stream resource in D:\inetpub\vhosts\inthegames.net\httpdocs\newsthanks.php on line 14 Warning: fclose(): supplied argument is not a valid stream resource in D:\inetpub\vhosts\inthegames.net\httpdocs\newsthanks.php on line 15 Quote Link to comment https://forums.phpfreaks.com/topic/50736-new-looking-for-help/#findComment-249458 Share on other sites More sharing options...
xItalia Posted May 10, 2007 Author Share Posted May 10, 2007 one of the tutorials i found on this site basically was the same script... but for some reason it doesnt work.. it doesnt give me errors if i take out the last 3 lines but.. obviosuly.. Quote Link to comment https://forums.phpfreaks.com/topic/50736-new-looking-for-help/#findComment-249472 Share on other sites More sharing options...
xItalia Posted May 10, 2007 Author Share Posted May 10, 2007 does anyone know? i used to have it working a long time ago but i lost all my codes and i basically did it by troubleshooting Quote Link to comment https://forums.phpfreaks.com/topic/50736-new-looking-for-help/#findComment-249516 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.