Page 1 of 1

simple updating news page?

Posted: Wed May 23, 2007 2:12 pm
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

Posted: Wed May 23, 2007 2:20 pm
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 :)

Posted: Wed May 23, 2007 4:10 pm
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?

Posted: Wed May 23, 2007 4:38 pm
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

Posted: Wed May 23, 2007 5:10 pm
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.