sillyrabbi Posted May 23, 2007 Share Posted May 23, 2007 So I'm designing a company's web page and they would like a news page that's easy for them to update. Ultimately what I'd like to give them is two pages. One that lists the 5 most recent headlines of news stories and links to a page with the full story, and another page that does the same thing, except lists every single news article they've ever had. What I'm looking for is a way I can code my page so that my client can simply create a news story in only one document, save it to a folder called "news" or similar on the FTP, and have both listing/link pages automatically display it's headline and link to it. Would this be possible using PHP? If so, can you give me any advice on how I would accomplish this? I've looked around on the web, and found several tutorials, but nearly all of them include creating a submission form and using mySQL, which I'd really rather not bother with. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/52719-simple-updating-news-page/ Share on other sites More sharing options...
Wildbug Posted May 24, 2007 Share Posted May 24, 2007 You can simply use a file to store your links -- one per line -- instead of MySQL. Take the first five lines (or last five lines; whichever are most recent) for the headlines page; take the rest for the archive page. If you need more data, like dates and a synopsis, you can also include that, seperated from each other with delimiters. "Flat" file format: 01/01/2007, http://www.news-site.com/story/123, AP - It's New Year's again.....blah blah blah. 01/01/2007, http://www.newssite.com/story/456, Reuters - Blah Blah Blah See the PHP manual -- file system functions, string functions. That should get you started. (PHP can do it. It helped me lose 250 lbs AND grow all my hair back AND find true love AND fixed the leaky kitchen faucet. PHP does it all.) Quote Link to comment https://forums.phpfreaks.com/topic/52719-simple-updating-news-page/#findComment-260418 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.