Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > contents of .txt file to table cell?

Reply
Thread Tools

contents of .txt file to table cell?

 
 
Sean
Guest
Posts: n/a
 
      04-11-2005
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


 
Reply With Quote
 
 
 
 
Oli Filth
Guest
Posts: n/a
 
      04-11-2005
Sean wrote:
<SNIP>
> If so how can I do it?
>


Yes you want to use server-side processing. Investigate PHP
(http://www.php.net).

--
Oli
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      04-11-2005
Sean wrote:

> 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>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Nico Schuyt
Guest
Posts: n/a
 
      04-11-2005
Toby Inkster wrote:
> Sean wrote:
>
>> 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>


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

--
Nico
http://www.nicoschuyt.nl


 
Reply With Quote
 
Oli Filth
Guest
Posts: n/a
 
      04-11-2005
Nico Schuyt wrote:
> Toby Inkster wrote:
>
>>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> ?
>


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.


--
Oli
 
Reply With Quote
 
William Hamby
Guest
Posts: n/a
 
      04-12-2005
On 2005-04-11 15:57:40 -0400, "Sean" <(E-Mail Removed)> said:

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding contents on yaml file without overwriting actual contents Kamarulnizam Rahim Ruby 4 01-28-2011 09:10 AM
File Contents into Hash Table? James Rasmussen Ruby 6 08-27-2010 07:56 AM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM
Can I restrict both attribute contents and element contents in schema Don Adams XML 1 03-05-2004 12:48 PM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments