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
simple updating news page?
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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?
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
For the most part yeah, thats it.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?
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
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Basically it is the PHP native file system functions. Look at functions like opendir(), readdir(), closedir(), scandir() (PHP5 only), file(), is_file(), filetype(), etc.