Click to See Complete Forum and Search --> : Link to external Text File


Tom Fullen
04-24-2007, 07:50 PM
How to go about placing text in a table, that is reflective of the text contained in a simple text file, residing in the same directory.

For some time I have been searching for the answer to this. But it eludes me.

Why is it that we can place an image place holder on a page and link it to a .jpg, png, gif, etc. image file and yet there seems to be no way to insert a place holder for a text file? Or is there?

It seems so simple...

Any insight would help.

Running Apache on a Linux Server. Sites built with Adobe GoLive, HTML, and DreamWeaver.

Thanks,
Tom

ryanbutler
04-24-2007, 08:06 PM
You can read a tab-delimited text file through PHP quite easily and then display in corresponding table cells with a for loop. I wrote an article about it, hasn't been reviewed yet, but you should get the drift:

http://midwestwebdesign.net/tutorials/tabdelimited/index.php

If this isn't what you want, you'll need to be more specific.

ray326
04-24-2007, 11:14 PM
Server side includes will do it.

Tom Fullen
04-25-2007, 08:35 AM
Thanks ray326, can you elaborate a bit further? :cool:

ryanbutler
04-25-2007, 10:47 AM
Put text in a php page, save.

In your table:

<table>
<tr>
<td><?php include("text.php");?></td>
</tr>
</table>

Upload both and that's it.

ray326
04-25-2007, 04:56 PM
http://httpd.apache.org/docs/1.3/howto/ssi.html

<!--#include virtual="/footer.html" -->

You can do it programmatically as Ryan shows if you're also running PHP on that stack. This kind of include is handled directly by Apache.