Results 1 to 4 of 4

Thread: text or .doc file controlled web content

  1. #1
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default text or .doc file controlled web content

    I was wondering if its possible to link a content section of a html page to a .txt or a .doc file so if for example i make a page and the client wants to update the content him self so he opens the .doc or .txt file and any changes that he does there in that file automaticaly changes in the html page or web site

  2. #2
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well... as far as i know .doc files will force microsoft word to open. However, if you include .txt files then they will be able to be edited via IE or FF. You could write a php script to fopen the txt files and the client, or what not, can open it from IE and FF and edit it directly.

    hope this helps.

  3. #3
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    let me expalin it a little more in this diagram

    for example here is a black content in a website .html file

    ....


    and here is a .txt file

    .....


    so if you for example change that to a ? at the end it will automatically change it in the html file so that the html file when opend will have

    .....?

    i am still looking for the code but will post if i get it before anyone here

    so please give all the help you can


    _______
    for all the hosting needs go to www.bitnethosting.com
    and if you require a custom account that will also be set up apon requesr
    ref: 8855123

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Beau, neither FF nor IE will let you edit a text file.

    Using a .txt would be the best answer; .doc is a proprietary format that has a LOT of extra junk in it, so parsing all of that and making into it into html would be a pain.

    Either way, it's quite easy with PHP, like was said. But... you don't need to bother with fopen().

    All you need is this:

    <?php file_get_contents('yourfile.txt'); ?>

    Note: .txt is just a note to the computer for what filetype it is. You could use .inc (include), .doc (just not use a MS word file), etc., or even create your own (.content), or something. Doesn't really matter all that much.


    Note that to use PHP:
    1. Your server must have PHP installed/enabled.
    2. Your page must end in .php (not .htm; it will work the same as .htm, though; don't worry)*
    (*you could also deal with changing the .htaccess config file so .htm is parsed with php, but that's probably more than is worth dealing with.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •