Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using external text file in an HTML page.

Status
Not open for further replies.

sborny

Technical User
Jun 29, 2001
157
GB
Hi,

Fairly new to HTML etc, does anyone know if it it possible to pull the text content of a HTML page from a text file.

The reason being is that the content of the site will be changed very often and rather re code the whole page I would like to just change the text file and the page updates automatically.

Thanks in Advance.

Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
If you have a server that supports server side commands you could be able to include the text part of the page in a page layout. Somewhat like this:
Code:
<html>
<head>
...
<!--#include file=&quot;filename.txt&quot;-->
or
<!--#include virtual=&quot;/txtfiles/filename.txt&quot;-->
(use virtual if your file resides in a virtual path on the server)
...
</head>
</html>

Bear in mind though, that the text you enter from txt will not be formatted in any way (not even line breaks will be visible).

Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top