Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking a text file to a template?

    Hi,

    I just wondered if it would be possible to link a text file to a Dreamweaver template... I have a site based around one template with an editable region in each page, but I thought it would be a good idea if someone else could update pages using a text file and uploading it to the server periodically. My idea is that they could save HTML code as a text file and pages would then be updated with the content they wrote.

    Is this possible?

  • #2
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    If you rename your (X)HTML page with a ".php" extension (assuming your server supports PHP) then you can replace the text in your document with:
    PHP Code:
    <?php
    include 'text.txt';
    ?>
    Now when your original document is rendered, it will include the 'text.txt' file specified wherever you place the include function. The text file can be changed as often as you want.


    http://us3.php.net/manual/en/function.include.php
    http://us3.php.net/manual/en/function.include-once.php
    http://us3.php.net/manual/en/function.require.php
    http://us3.php.net/manual/en/function.require-once.php
    Last edited by kewlceo; 05-14-2007 at 01:27 PM.
    UBERHOST.NET
    Shared, reseller, semidedicated hosting and dedicated server plans.
    DirectAdmin Installatron Money-Back Guarantee 24/7 Support
    Providing "Service Above All Else" since 2005.

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's fantastic, thanks kewlceo!

  • #4
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by GOAT2G View Post
    That's fantastic, thanks kewlceo!
    Glad to help!











    <--- Shameless add to reputation plug.


  •  

    Posting Permissions

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