Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.