contents of .txt file to table cell?

S

Sean

I've created a front page to be used as a mini notice board for our work
intranet.

A table has been created which is divided into 6 cells. Each cell will be a
single noticeboard area with a quick explaination and a link to a document
letter, memo etc.... Currently I trudge through the mass code and change
the contents of these six boxes when new items want to be put on the board.
Is there anyway I can get each cell to display the contents of a single text
file? My idea is that I have 6 text files named 1.txt , 2.txt , 3.txt
etc.... that other none HTML people can just edit and save and therefore
update the contents of the noticeboard without me needing to do anything?

If so how can I do it?

Thanks,

Sean
 
T

Toby Inkster

Sean said:
My idea is that I have 6 text files named 1.txt , 2.txt , 3.txt
etc.... that other none HTML people can just edit and save and therefore
update the contents of the noticeboard without me needing to do anything?

Depends on what server-side scripting capabilities your server has.

Here's an example using PHP:

<table>
<tr>
<td><? include "1.txt" ?></td>
<td><? include "2.txt" ?></td>
</tr>
<tr>
<td><? include "3.txt" ?></td>
<td><? include "4.txt" ?></td>
</tr>
<tr>
<td><? include "5.txt" ?></td>
<td><? include "6.txt" ?></td>
</tr>
</table>
 
N

Nico Schuyt

Toby said:
Depends on what server-side scripting capabilities your server has.

Here's an example using PHP:

<table>
<tr>
<td><? include "1.txt" ?></td>
<td><? include "2.txt" ?></td>
</tr>
<tr>
<td><? include "3.txt" ?></td>
<td><? include "4.txt" ?></td>
</tr>
<tr>
<td><? include "5.txt" ?></td>
<td><? include "6.txt" ?></td>
</tr>
</table>

Shouldn't that be: <PRE><? include "1.txt"; ?></PRE> ?
 
O

Oli Filth

Nico said:
Shouldn't that be: <PRE><? include "1.txt"; ?></PRE> ?

No, tis fine as it is. However the opening delimiter should be <?php to
be on the safe side. <? only works if short_open_tag is enabled.
 
W

William Hamby

I've created a front page to be used as a mini notice board for our work
intranet.

A table has been created which is divided into 6 cells. Each cell will be a
single noticeboard area with a quick explaination and a link to a document
letter, memo etc.... Currently I trudge through the mass code and change
the contents of these six boxes when new items want to be put on the board.

Tables are for tabular data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top