Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

advice on including HTML pages

Status
Not open for further replies.

knuckle05

Programmer
Dec 17, 2001
247
CA
Hi All,

I have a page built with a header and a left navigation menu. I'd like to keep it dynamic enough that if i want to make any changes, I don't want to have to update the same thing on 30 different pages.

How can I include these regions on my page?
I'd like to avoid using frames if possible...thx!
 
if your server supports SSI then use it

<# include virtual=&quot;filename.htm&quot; #>

your pages must be shtml extenstions tho

php is easier

<? include 'filename.htm' ?>

asp is the same format as SSI

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
how can i be sure that they each remian a certain width and height?

Where do I put these directives? In the <HEAD> tags?
 
SSI include directives only take the contents of an external file and include it where you put the directive.

Put that directive where you want the code that is in the file to appear.

There is no width and height associated with an include directive.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
lool talk about being off the mark --

how it works is simple -- you have an external file called leftbar.htm which holds the table for your navigation -- lets say the table is 200px wide when you call that file then the table will take up 200px width in the page.

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Well,

I've tried the SSI and it seems to work when I open the file from within Dreamweaver, but when I publish it to my IIS, it tells me &quot;404 Object Not found&quot;

BTW, I am just testing this locally on my Win 2000 machine, not actually on the web
 
with SSI your files must have a .shtml extension

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
&quot;with SSI your files must have a .shtml extension&quot;

That is, the (X)HTML file that includes the <!--#include statement generally has to be given a .shtml extension (though there are ways around this). The files you are going to include can have any extension you like, if any at all.

You can find more info on SSI at faq253-3309

-- Chris Hunt
 
Well, I've double-checked everything, and still no luck.

Is there something I may need to configure in IIS?
 
Create a page with a basic SSI code such as:

<!--#echo var=&quot;HTTP_USER_AGENT&quot; -->
- OR -
<!--#echo var=&quot;DOCUMENT_NAME&quot; -->

with the correct ssi file extension for your server.

if you see a blank page then SSI is probably not working. View source of the page and if you see the SSI code then it's definitly not working!!

You will then need to enable it on your server.







- É -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top