Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 04-27-2004, 05:10 AM   #1
Default Newbie Question: How can I link to some HTML in another page?


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
  Reply With Quote
Old 04-27-2004, 05:16 AM   #2
Nik Coughin
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

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?


  Reply With Quote
Old 04-27-2004, 05:21 AM   #3
Nik Coughin
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

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 >


  Reply With Quote
Old 04-27-2004, 06:38 AM   #4
Mark Parnell
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

On Tue, 27 Apr 2004 04:10:02 GMT, "michaaal" <>
declared in alt.html:

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


http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another

BTW: http://www.allmyfaqs.com/faq.pl?Tableless_layouts

--
Mark Parnell
http://www.clarkecomputers.com.au
  Reply With Quote
Old 04-27-2004, 07:07 AM   #5
michaaal
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

> http://www.allmyfaqs.com/faq.pl?Incl...ile_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?


  Reply With Quote
Old 04-27-2004, 07:29 AM   #6
Mark Parnell
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

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_vajzo...eb/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
  Reply With Quote
Old 04-27-2004, 08:58 AM   #7
SpaceGirl
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?


"michaaal" <> wrote in message
news:%Mmjc.41719$...
> > http://www.allmyfaqs.com/faq.pl?Incl...ile_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>


  Reply With Quote
Old 04-27-2004, 11:30 AM   #8
Jukka K. Korpela
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

"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


  Reply With Quote
Old 04-27-2004, 06:53 PM   #9
Toby A Inkster
 
Posts: n/a
Default Re: Newbie Question: How can I link to some HTML in another page?

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

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump