Log in

View Full Version : Content update



vantheman2
08-06-2007, 04:45 PM
Content update

Hi,
I'm fairly new at writing scripts, but trying to learn.
Anyway, I'm working on a site that will require frequent content updates from the site owner who is NOT technically savy. Is there a php script that can display the content from a simple text file onto a web page? This way, all she would have to do is update the text file.

If not, what would be the best approach for this issue?

Thanks in advance
Van

Twey
08-06-2007, 05:30 PM
<?php echo htmlentities(file_get_contents('/path/to/file.txt')); ?>

vantheman2
08-06-2007, 07:00 PM
Thanks Twey. I'll try it and see how it works.

vantheman2
08-06-2007, 07:03 PM
Is this script placed in the html code, or saved as a php file.....not quite sure where to put it.

Twey
08-06-2007, 07:05 PM
Placed where you would have the output, as with any PHP.

vantheman2
08-08-2007, 12:08 AM
I have the code (<?php echo htmlentities(file_get_contents('/public _html/test2/clienttext.txt')); ?>) placed in the html exactly where I want it to appear on the page.....and I have "clienttext.txt" residing in the same folder on the server. But for some reason, it's not working. Any clue as to what I'm doing wrong?

vantheman2
08-08-2007, 12:10 AM
is there and special code that needs to go in the text file?

Twey
08-08-2007, 03:16 AM
No. Are you sure the page is being parsed as PHP?

vantheman2
08-08-2007, 10:29 AM
Thanks for responding Twey. No I didn't have it parsed as php. Like I said I'm a newbie, so please excuse my ignorance. I also read through another thread where you helped someone else with the same issue, and got insight from it. So I will give this a try.

Thanks again