Including text From Other Pages or Text Files

Discussion in 'HTML' started by Elliot J, Jul 27, 2007.

  1. Elliot J

    Elliot J Guest

    Hi all,

    What I want to do is probably pretty basic, but as I've had no cause to look
    into it previously, I'm currently a bit clueless.

    Imagine I have a HTML front page (frontpage.htm), and a text file (test.txt)
    on the same server.

    I'm trying to find a way to link the text from test.txt into a table on my
    front page, dynamically. So if I change the contents of test.txt then
    refresh frontpage.htm, I can see the new text in the table.

    To go one further, I would like to link certain blocks of text (ie: specific
    contents of cells within a table) from a .htm file into my frontpage.htm
    file in the same fashion.

    I have been trawling the net for answers, but all I keep hitting on is
    anchors and how to link to other pages.

    If anyone can direct me to the commands to research or some
    references/examples for what I'm trying to achieve, I would be extremely
    grateful.

    Thanks in advance.

    EJ
    Elliot J, Jul 27, 2007
    #1
    1. Advertising

  2. Elliot J

    John Hosking Guest

    Elliot J wrote:

    > What I want to do is probably pretty basic, but as I've had no cause to look
    > into it previously, I'm currently a bit clueless.


    >
    > I'm trying to find a way to link the text from test.txt into a table on my
    > front page, dynamically. So if I change the contents of test.txt then
    > refresh frontpage.htm, I can see the new text in the table.
    >
    > To go one further, I would like to link certain blocks of text (ie: specific
    > contents of cells within a table) from a .htm file into my frontpage.htm
    > file in the same fashion.


    I don't know how you can do this (further one). Any near-solutions I can
    think of are more work than they're worth.

    >
    > I have been trawling the net for answers, but all I keep hitting on is
    > anchors and how to link to other pages.


    Fairly amazing. I pasted your post's title into my search engine and got
    several likely candidates. But for quick-and-easy, I dug up the FAQ,
    because this question and that answer come up here regularly.

    >
    > If anyone can direct me to the commands to research or some
    > references/examples for what I'm trying to achieve, I would be extremely
    > grateful.


    Does this help you?
    http://www.htmlhelp.com/faq/html/design.html#include-file

    --
    John
    John Hosking, Jul 27, 2007
    #2
    1. Advertising

  3. "Elliot J" <> writes:

    > To go one further, I would like to link certain blocks of text (ie: specific
    > contents of cells within a table) from a .htm file into my frontpage.htm
    > file in the same fashion.
    >
    > I have been trawling the net for answers, but all I keep hitting on is
    > anchors and how to link to other pages.
    >
    > If anyone can direct me to the commands to research


    The term for what you want is "server side includes", or "SSI". Here's a
    tutorial - if you're not using Apache, you can skip the server config
    section of it, but the part that describes how to write your HTML should
    still be relevant, unless you're on a *very* strange server.

    <http://httpd.apache.org/docs/2.2/howto/ssi.html>

    sherm--

    --
    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Sherm Pendley, Jul 27, 2007
    #3
  4. Elliot J

    Amos E Wolfe Guest

    "Elliot J" <> wrote in message
    news:f8d7c1$2mc$1$...
    > Hi all,
    >
    > What I want to do is probably pretty basic, but as I've had no cause to
    > look into it previously, I'm currently a bit clueless.
    >
    > Imagine I have a HTML front page (frontpage.htm), and a text file
    > (test.txt) on the same server.
    >
    > I'm trying to find a way to link the text from test.txt into a table on my
    > front page, dynamically. So if I change the contents of test.txt then
    > refresh frontpage.htm, I can see the new text in the table.
    >


    assuming your server has php installed:

    rename frontpage.htm to frontpage.php and include the line

    <?php include("test.txt");?>

    --
    -=# Amos E Wolfe #=-
    AIM: Traindriver9334
    Get Firefox: http://www.spreadfirefox.com/?q=user/register&r=122394
    Amos E Wolfe, Jul 27, 2007
    #4
  5. Elliot J

    Elliot J Guest

    "Sherm Pendley" <> wrote in message
    news:...
    > "Elliot J" <> writes:
    >
    >> To go one further, I would like to link certain blocks of text (ie:
    >> specific
    >> contents of cells within a table) from a .htm file into my frontpage.htm
    >> file in the same fashion.
    >>
    >> I have been trawling the net for answers, but all I keep hitting on is
    >> anchors and how to link to other pages.
    >>
    >> If anyone can direct me to the commands to research

    >
    > The term for what you want is "server side includes", or "SSI". Here's a
    > tutorial - if you're not using Apache, you can skip the server config
    > section of it, but the part that describes how to write your HTML should
    > still be relevant, unless you're on a *very* strange server.
    >
    > <http://httpd.apache.org/docs/2.2/howto/ssi.html>
    >
    > sherm--
    >
    > --
    > Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    > Cocoa programming in Perl: http://camelbones.sourceforge.net


    Hi all and thanks for the feedback.

    I tried Amos' suggestion, which did what I wanted to a degree, but I ended
    up using .csv files for my data and pulling it into web pages with
    OBJECTS/Datasrc's.

    My gratitude to all who responded.
    Elliot J, Aug 6, 2007
    #5
    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. Judges1318
    Replies:
    2
    Views:
    568
    Judges1318
    Aug 6, 2005
  2. Raman
    Replies:
    5
    Views:
    352
    Lew Pitcher
    Jun 7, 2008
  3. Chad Perrin

    including other files with eruby

    Chad Perrin, Mar 29, 2007, in forum: Ruby
    Replies:
    1
    Views:
    107
    Chad Perrin
    Mar 29, 2007
  4. Nathan Beyer
    Replies:
    0
    Views:
    104
    Nathan Beyer
    Nov 15, 2009
  5. Catherine Lynn Smith

    Including other .js files from javascript

    Catherine Lynn Smith, Sep 30, 2003, in forum: Javascript
    Replies:
    1
    Views:
    103
    Catherine Lynn Smith
    Sep 30, 2003
Loading...

Share This Page