Results 1 to 9 of 9

Thread: Content update

  1. #1
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Content update

    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

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <?php echo htmlentities(file_get_contents('/path/to/file.txt')); ?>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Twey. I'll try it and see how it works.

  4. #4
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is this script placed in the html code, or saved as a php file.....not quite sure where to put it.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Placed where you would have the output, as with any PHP.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  7. #7
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    is there and special code that needs to go in the text file?

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No. Are you sure the page is being parsed as PHP?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •