HTML Include command?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

Hopefully a simple solution to this problem.

I want to use some common elements in my web pages but want to store them
centrally so I only need to change one file instead of multiple.

I use it in programming just now so am sure it can be done.

I have say a file page1.html which is standard text, and I wwant to include
the information on page2.html in the middle section.  Is there a way I can

Call or Include page2.html

If I strip out all the head and body tags, surely I should be able to put
this in?

Anyone any ideas?



Re: HTML Include command?

To my knowledge, there isn't a way to do it without stuff like iframe
and what not.  Does your hosting provide PHP support?  If so:

<?php include("page2.php"); ?>

Re: HTML Include command?

Quoted text here. Click to load it

There isn't an html include. (I wish there was!)

See if your server supports server side includes, I think that might give
you what you are after (but I've not used them, so could be wrong).

An alternative would be to use JavaScript, to generate the common content.
The trouble with this is that you can't rely on everyone having JavaScript

Hope this helps.
Brian Cryer

Re: HTML Include command?

Jackmac wrote:

Quoted text here. Click to load it

David Dorward       < <
                     Home is where the ~/.bashrc is

Re: HTML Include command?

On Thu, 13 Oct 2005 16:35:18 +0100, Jackmac wrote:

Quoted text here. Click to load it

The easiest way is with PHP:

You can use the "include" statement.

Site Timeline