Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with a news/article system
Old 07-12-2006, 02:50 PM Help with a news/article system
DavetheSniper's Avatar
Junior Talker

Posts: 2
Name: David
Trades: 0
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
Attached Files
File Type: zip news_system.zip (9.3 KB, 4 views)

Last edited by DavetheSniper; 07-12-2006 at 03:04 PM..
DavetheSniper is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-14-2006, 04:56 PM Re: Help with a news/article system
camp185's Avatar
Super Talker

Posts: 127
Trades: 1
I did something different to give same results. I add all news articles to database. I then hit a page that I created to read db, and write the news feed rss/xml. I also created a second page that reads the same db info to display to my readers on the site.
__________________
Improve your website! Get a
Please login or register to view this content. Registration is FREE
!
camp185 is offline
Reply With Quote
View Public Profile Visit camp185's homepage!
 
Reply     « Reply to Help with a news/article system
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09970 seconds with 13 queries