• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

including txt file in HTML?

zimu

Diamond Member
I've got this webpage, and want some of the content to be "dynamic"- in that it loads up some txt file in the directory. In that way I can just modify the txt file and have the homepage change rather than having to modify the html.

How can i do this?

Thanks
 
Depends on what server-side scripting your hosting company offers for your server -- ASP, PHP, JSP etc.

Tell us what your hosting account is set up for (visit your hosting company sales / support pages to find out) and tell us whether its an IIS or Apache server if you can find out.

For most it would be simple to embed a fixed block of script code to "insert text file here" in the middle of your page.
 
I was hoping it wouldnt' be that complicated. THere is no way to have somethign simply like "embed src = text.txt" or "embed src = text.html"?

I've used cold fusion programming, in that its SO simple, you just say "cfinclude template = "text.txt"" and it will include the text file in the html.

I'm not too sure what kind of server my host is running, I didn't think i needed to?

Thanks

 
I think you're going to have to know what your host offers for this to happen... Even cold fusion has to be supported at the server side for this to work.

My recommendation -- give it a try! If it doesn't work, you've lost nothing. If it does, you've won.
 
if your web server supports server side include (SSI), you can write a simple perl script that goes out to read the text out of a file and print them line by line to the html output ...

otherwise, write your whole html page in cgi/jsp/asp and the likes?
 
Try the most common server side include tag?

<!-- #include file="dynamic.txt" -->

There's a list of more common include tags here.
 
Back
Top