News page updating from text document

Freakboy

Expert Member
Joined
Feb 13, 2006
Messages
1,281
Reaction score
85
Location
Centurion
Hi Guys,

I'm new to web design and in need of a little help. I was given the task to redo our website (bosses to stingy to get a professional) and the problem that I see coming is the news page. They want to be able to update the news page dynamically from a text document saved on the server/specific location. This is so that the HR/PR lady can just edit the text document and then the page will automatically be updated. She then doesn’t have to touch the site/web server.

Any ideas how to accomplish this?
 
If you use php, you can use the "file_get_contents" function.
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.

file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance.

The link also contain a lot of examples, and solutions to problems.
 
Oh, and have a look at nl2br to convert the newlines to breaks in html.
Description
string nl2br ( string $string [, bool $is_xhtml ] )

Returns string with '<br />' or '<br>' inserted before all newlines.
 
I had a nice little Java newsreader I grabbed from an opensource coding site. Could read and format text nicely from a wittle .txt file you post on the site.

Just look around and pick a technology
 
Why don't you install Joomla on the web server, then the admin lady can just update via an back-end web interface.
 
Why don't you install Joomla on the web server, then the admin lady can just update via an back-end web interface.

I thought of Drupal (or Joomla) too, but they might be using a custom CMS already, and the lady doing to update might be very challenged when it comes to technology. From experience, most HR/PR people are :p
 
Why not just use XML/XSLT? Train her in the syntax of your XML file and let XSLT do the wonders for you. That way, you don't need any CMS or server-side coding...
 
Top
Sign up to the MyBroadband newsletter
X