...

View Full Version : Linking a text file to a template?



GOAT2G
05-14-2007, 10:08 AM
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?

kewlceo
05-14-2007, 01:25 PM
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
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

GOAT2G
05-14-2007, 09:15 PM
That's fantastic, thanks kewlceo!

kewlceo
05-15-2007, 04:22 PM
That's fantastic, thanks kewlceo!

Glad to help!











<--- Shameless add to reputation plug. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum