Newbie Question: How can I link to some HTML in another page?

Discussion in 'HTML' started by michaaal, Apr 27, 2004.

  1. michaaal

    michaaal Guest

    For example let's say I have a file called "file1.htm" that contains the
    following data...

    <table>
    <tr><td>hello</td></tr>
    </table>

    ....Now let's say I want to make a file and link it so the "file1.htm" file
    like this...

    <html>
    <body>
    <h2>hello</h2>
    <<<<link this section to the FILE1.HTM file>>>>
    </body>
    </html>

    ....How would I do that? Would it be something like this?...

    <html>
    <body>
    <h2>hello</h2>
    <http://www.mydomain.com/file1.htm>
    </body>
    </html>
    michaaal, Apr 27, 2004
    #1
    1. Advertising

  2. michaaal

    Nik Coughin Guest

    michaaal wrote:
    > For example let's say I have a file called "file1.htm" that contains
    > the following data...
    >
    > <table>
    > <tr><td>hello</td></tr>
    > </table>
    >
    > ...Now let's say I want to make a file and link it so the "file1.htm"
    > file like this...
    >
    > <html>
    > <body>
    > <h2>hello</h2>
    > <<<<link this section to the FILE1.HTM file>>>>
    > </body>
    > </html>
    >
    > ...How would I do that? Would it be something like this?...
    >
    > <html>
    > <body>
    > <h2>hello</h2>
    > <http://www.mydomain.com/file1.htm>
    > </body>
    > </html>


    <html>
    <body>
    <h2>hello</h2>
    <a href="http://www.mydomain.com/file1.htm">My File 1</a>
    </body>
    </html>

    Or did you mean that you want to include the contents of file1.htm at that
    point in the second file?
    Nik Coughin, Apr 27, 2004
    #2
    1. Advertising

  3. michaaal

    Nik Coughin Guest

    Nik Coughin wrote:
    > michaaal wrote:
    >> For example let's say I have a file called "file1.htm" that contains
    >> the following data...
    >>
    >> <table>
    >> <tr><td>hello</td></tr>
    >> </table>
    >>
    >> ...Now let's say I want to make a file and link it so the "file1.htm"
    >> file like this...
    >>
    >> <html>
    >> <body>
    >> <h2>hello</h2>
    >> <<<<link this section to the FILE1.HTM file>>>>
    >> </body>
    >> </html>
    >>
    >> ...How would I do that? Would it be something like this?...
    >>
    >> <html>
    >> <body>
    >> <h2>hello</h2>
    >> <http://www.mydomain.com/file1.htm>
    >> </body>
    >> </html>

    >
    > <html>
    > <body>
    > <h2>hello</h2>
    > <a href="http://www.mydomain.com/file1.htm">My File 1</a>
    > </body>
    > </html>
    >
    > Or did you mean that you want to include the contents of file1.htm at
    > that point in the second file?


    That looks screwy in Outlook Express. When I look at the message source
    there's nothing wrong with it. It should look like (without the extra
    spaces):

    < a h r e f = " h t t p : / / w w w . m y d o m a i n . c o m / f i l e 1
    .. h t m " > M y F i l e 1 < / a >
    Nik Coughin, Apr 27, 2004
    #3
  4. michaaal

    Mark Parnell Guest

    Mark Parnell, Apr 27, 2004
    #4
  5. michaaal

    michaaal Guest

    > http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another

    Yes, Mark, this is what I am talking about. But how can you do it with just
    straight HTML and not do it.

    So far, I have found this method...

    <frameset>
    <frame src="http://www.yahoo.com">
    </frameset>


    Is this the best way to do this?
    michaaal, Apr 27, 2004
    #5
  6. michaaal

    Mark Parnell Guest

    On Tue, 27 Apr 2004 06:07:55 GMT, "michaaal" <>
    declared in alt.html:

    > Yes, Mark, this is what I am talking about. But how can you do it with just
    > straight HTML and not do it.


    You can't. HTML doesn't *do* anything. It is a markup language - it
    simply describes the structure of the content. Eventually you will
    probably want server-side scripting, and most server-side languages have
    some form of includes built it. Even if you don't have access to
    server-side scripting, any decent host will offer SSI (and you may be
    able to use it even if they don't think you can), and even if they don't
    you can always use a preprocessor.

    > <frameset>
    > <frame src="http://www.yahoo.com">
    > </frameset>


    *<shudder>*
    There is certainly no need to resort to that sort of heresy.

    http://html-faq.com/htmlframes/?framesareevil
    http://homepage.ntlworld.com/l_vajzovic/tom/web/frames.html
    http://dorward.me.uk/www/frames/
    http://www.google.com/webmasters/2.html (see under "Your page uses
    frames")

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Apr 27, 2004
    #6
  7. michaaal

    SpaceGirl Guest

    "michaaal" <> wrote in message
    news:%Mmjc.41719$...
    > > http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another

    >
    > Yes, Mark, this is what I am talking about. But how can you do it with

    just
    > straight HTML and not do it.
    >
    > So far, I have found this method...
    >
    > <frameset>
    > <frame src="http://www.yahoo.com">
    > </frameset>
    >
    >
    > Is this the best way to do this?



    Frames are *not* the best way to go - while they work, it's a bad path to
    start walking down for a n00b as they can lead to all kinds of
    complications. There are times and places for frames, but not until you
    understand the consiquences of using them.

    The single best way to include one file inside another is to use a
    server-side include. Assuming your server supports ASP (basically, if you
    are using a Microsoft webserver called "Internet Information Server", or
    IIS) this is achieved fairly painlessly;

    <!--#include file="folder/file.htm" -->

    The folder can be anywhere inside your website, and the file can be any text
    file (such as .htm, .asp, .txt). The contents of the file are "added" to the
    page by the server *before* the page is sent to the users browser, so they
    will have no indication that included files were used to stick your page
    together. An include can be placed *anywhere* inside your HTML document.

    <p>some stuff <br /> another line </p>
    <hr />
    <!--#include file="folder/file.htm" -->
    <hr />
    <p>more stuff</p>
    SpaceGirl, Apr 27, 2004
    #7
  8. "Nik Coughin" <nrkn!no-spam!@woosh.co.nz> wrote:

    > That looks screwy in Outlook Express.


    What "that"? Please quote the relevant part only, or otherwise make your
    references clear. Also please use descriptive words, not emotional.

    > It should look like (without
    > the extra spaces):
    >
    > < a h r e f = " h t t p : / / w w w . m y d o m a i n . c o m / f i
    > l e 1 . h t m " > M y F i l e 1 < / a >


    <marquee>Then why do you use extra spaces?</marquee>

    <font size="7" color="red" face="Verdana">
    If your newsreader surrogate interprets HTML tags in Usenet messages,
    fix its settings, or get a decent newsreader.</font>

    <iframe title="Here I could have put some nasty code that crashes OE"
    src="...">
    </iframe>

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Apr 27, 2004
    #8
  9. Jukka K. Korpela wrote:

    > <iframe title="Here I could have put some nasty code that crashes OE"
    > src="...">
    > </iframe>


    Or even more fun...

    begin hiding

    Nobody using OE can see me.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Apr 27, 2004
    #9
    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. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    802
    Kevin Spencer
    May 17, 2005
  2. ad
    Replies:
    2
    Views:
    711
  3. johnjohn
    Replies:
    0
    Views:
    499
    johnjohn
    Sep 6, 2006
  4. Marina Limeira

    LINK with another link

    Marina Limeira, Feb 7, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    106
    Marina Limeira
    Feb 7, 2006
  5. Duke
    Replies:
    1
    Views:
    153
    Tom de Neef
    Apr 18, 2008
Loading...

Share This Page