simple updating news page?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sillyrabbi
Forum Newbie
Posts: 2
Joined: Wed May 23, 2007 1:55 pm

simple updating news page?

Post by sillyrabbi »

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 headline. 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?

thanks
Wade
Forum Commoner
Posts: 41
Joined: Mon Dec 18, 2006 10:21 am
Location: Calgary, AB, Canada

Post by Wade »

The easiest method might be to check out pre-existing CMS (Content Management System) packages. There are alot out there, some are free, some are pay for.

I'd start with Google and see where that leads you...

Just my $0.02 :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Use the files system. If you are doing what I think you are doing.

I have a system I recently implemented for HR at my company where they FTP a file to their directory on the server. The index page scans that directory and locates the file name and in turn, displays a link to the file. When clicked, the file renders.

Is that what you are looking to do?
sillyrabbi
Forum Newbie
Posts: 2
Joined: Wed May 23, 2007 1:55 pm

Post by sillyrabbi »

Everah wrote:Use the files system. If you are doing what I think you are doing.

I have a system I recently implemented for HR at my company where they FTP a file to their directory on the server. The index page scans that directory and locates the file name and in turn, displays a link to the file. When clicked, the file renders.

Is that what you are looking to do?
For the most part yeah, thats it.

I think eventually I'm going to want find a way I can have a page just display links to the 5 most recent documents, either by looking at the date modified, or even better via a variable set in the news story document itself that contains the date.

But what you describe is certainly what I want for one of my pages, so can you tell me what this "files system" is? and is there a tutorial somewhere for it?

thanks
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Basically it is the PHP native file system functions. Look at functions like opendir(), readdir(), closedir(), scandir() (PHP5 only), file(), is_file(), filetype(), etc.
Post Reply