contents of .txt file to table cell?

Discussion in 'HTML' started by Sean, Apr 11, 2005.

  1. Sean

    Sean Guest

    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
     
    Sean, Apr 11, 2005
    #1
    1. Advertising

  2. Sean

    Oli Filth Guest

    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
     
    Oli Filth, Apr 11, 2005
    #2
    1. Advertising

  3. Sean

    Toby Inkster Guest

    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
     
    Toby Inkster, Apr 11, 2005
    #3
  4. Sean

    Nico Schuyt Guest

    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
     
    Nico Schuyt, Apr 11, 2005
    #4
  5. Sean

    Oli Filth Guest

    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
     
    Oli Filth, Apr 11, 2005
    #5
  6. On 2005-04-11 15:57:40 -0400, "Sean" <> 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.
     
    William Hamby, Apr 12, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RWFybCBUZWlncm9i?=

    Addressing Table Cell Contents in DOM using .all[nn] or ???

    =?Utf-8?B?RWFybCBUZWlncm9i?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    376
    =?Utf-8?B?RWFybCBUZWlncm9i?=
    Oct 22, 2004
  2. PJ6
    Replies:
    1
    Views:
    385
    darrel
    Aug 17, 2005
  3. Aaron
    Replies:
    0
    Views:
    389
    Aaron
    Dec 29, 2005
  4. Sameen
    Replies:
    2
    Views:
    450
    Victor Bazarov
    Aug 29, 2005
  5. Jochen Brenzlinger
    Replies:
    7
    Views:
    5,592
    Roedy Green
    Sep 15, 2011
Loading...

Share This Page