hey everyone,
im new to php and have been playing with some script for hours. I have a news system, which when i add news, it updates the site. As I want the news to be displayed on the homepage it needs to fit in. at the moment the script is taking the template page, and adding the news for the first page only. after that it is copying the whole page again below for every news that i add. I hope someone can help me!!!
Here is the part of the script i think is going wrong
function add_article($filename, $news)
{
if(file_exists($filename)){
$fh = fopen($filename, "r");
$old_news = fread($fh, filesize($filename));
fclose($fh);
}
$fh = fopen($filename, "w");
$news = stripslashes($news);
fwrite($fh, "\n<!--ARTICLE-->\n$news $old_news");
fclose($fh);
}
please help me somebody
Sniper
here are all of the source files if anybody cares to look at them
Last edited by DavetheSniper; 07-12-2006 at 03:04 PM..
|