Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can text in a .txt file be displayed on a webpage?

3 views
Skip to first unread message

John Anderson

unread,
Feb 14, 2008, 10:26:50 AM2/14/08
to
Hi.

I'm wanting to make it so that the text on my web page is stored on a text
file on the Server so that when people access the website the browser reads
the text from the file and places it in the correct place on the Website. I
want to do this so that if I want to edit the text, all I have to do is edit
the information in the file and it automatically updates on the website.
This means I don't have to search through all the HTML to find the bit of
text I wish to edit. It also means that I'm less likely to edit the HTML by
mistake and screw the page up.

It's a bit like how you put a picture on to a website, except with text.

Can it be done, and if so, how?

Many thanks.

Adrienne Boswell

unread,
Feb 15, 2008, 10:01:35 AM2/15/08
to
Gazing into my crystal ball I observed "John Anderson"
<john.an...@yahoo.co.uk> writing in
news:T4Zsj.803$W%5....@fe70.usenetserver.com:

No, text files, type .txt will be parsed by the browser as text.

What you're after is server side includes, SSI. How you use them
depends on what you have available on the server. If you have PHP
available, you could do something like:

<body>
<?php include "menu_inc.php" ?>
<div id="content">
...
</div>
<?php include "footer_inc.php" ?>

If you have SSI, you could do:
<body>
<!-- #include = "menu_inc.inc"-->
and you would name your page page.shtml

Find out what is available on the server, then Google for SSI.


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

John Anderson

unread,
Feb 18, 2008, 7:16:44 AM2/18/08
to
I'm wanting to do it on an eBay Template I'm making, and eBay doesn't
support either.

Any other way of doing it?

Cheers.

"Adrienne Boswell" <arb...@yahoo.com> wrote in message
news:Xns9A454775C4A3...@69.28.186.121...

Adrienne Boswell

unread,
Feb 18, 2008, 11:05:45 AM2/18/08
to
Gazing into my crystal ball I observed "John Anderson"
<john.an...@yahoo.co.uk> writing in news:IGeuj.6813$Lo1.6127
@fe34.usenetserver.com:

> I'm wanting to do it on an eBay Template I'm making, and eBay doesn't
> support either.
>
> Any other way of doing it?
>
> Cheers.

Have you tried renaming the text file to something like "myfile.inc"?

0 new messages