Jump to content

New looking for help


xItalia

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/50736-new-looking-for-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/50736-new-looking-for-help/#findComment-249458
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.