| | |
footer and nav include
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2003
Posts: 3
Reputation:
Solved Threads: 1
I used to know how to do this but it seems as though time and new programming has passed me by. I just want to include a simple web page for a left nav bar and one for a footer. In Dreamweaver I use <!--#include file="includes/leftnav.htm" --> and it shows up in the preview but when I put the page on my host (tested on two hosts) and locally just opening the index.htm through my computer the inclues are not there. I also tried <include src="file.htm"> but that didn't work in either DW or explorer.
PLEASE can anyone help out. I just want this site as simple as possible but I don't want to have to deal with pasting the nav and footer on each page.
Thanks,
TMP
PLEASE can anyone help out. I just want this site as simple as possible but I don't want to have to deal with pasting the nav and footer on each page.
Thanks,
TMP
What you are doing by including files is called SSI, server side includes. Normally files which use SSI have an *.shtml extension but sometimes an *.html extension is supported as well.
SSI, as its name suggests, is performed server-side. Therefore, the server hosting the files needs to support it. Apparently the remote hosts you are using support SSI but your local computer does not, and therefore it won't work locally. That's okay - just upload the files and it should all work.
It's similar to how a web dev language such as PHP operates. You can't execute PHP code locally without installing Apache or the like on your home machine.
If you wish to be able to test SSI out locally, install the Apache server (windows version) on your home machine.
Otherwise, create a folder no one knows about on your remote host to do testing
SSI, as its name suggests, is performed server-side. Therefore, the server hosting the files needs to support it. Apparently the remote hosts you are using support SSI but your local computer does not, and therefore it won't work locally. That's okay - just upload the files and it should all work.
It's similar to how a web dev language such as PHP operates. You can't execute PHP code locally without installing Apache or the like on your home machine.
If you wish to be able to test SSI out locally, install the Apache server (windows version) on your home machine.
Otherwise, create a folder no one knows about on your remote host to do testing
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
Hmmm, you could download, install Apache, spend three hours poking it until it works, then setup PHP, go back to poking Apache, and learn how to do some absic PHP scripting, and persuade your host to install it.... or you could do this:
HTML and CSS Syntax (Toggle Plain Text)
<script type="text/html" src="header.htm"></script> and <script type="text/html" src="footer.htm"></script>
•
•
•
•
Originally Posted by Roberdin
Hmmm, you could download, install Apache, spend three hours poking it until it works, then setup PHP, go back to poking Apache, and learn how to do some absic PHP scripting, and persuade your host to install it.... or you could do this:
HTML and CSS Syntax (Toggle Plain Text)
<script type="text/html" src="header.htm"></script> and <script type="text/html" src="footer.htm"></script>
Check out my blog at http://www.shinylight.com for more stuff about web dev.
www.w3c.org has great information about xhtml and ssi 
you could also rename your pages to .php and include it using php
<?php include ... ?>
www.php.net function search: include

you could also rename your pages to .php and include it using php

<?php include ... ?>
www.php.net function search: include
:cheesy: a vBulletin fan community @ vBulletin.nl :cheesy:
Hey floris, welcome back - long time no see 
But that goes right back to the original problem ... his local computer won't execute PHP scripts

But that goes right back to the original problem ... his local computer won't execute PHP scripts
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
•
•
Join Date: Mar 2004
Posts: 94
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Roberdin
Hmmm, you could download, install Apache, spend three hours poking it until it works, then setup PHP, go back to poking Apache, and learn how to do some absic PHP scripting[/code]
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: iframes help
- Next Thread: Making a random playlist?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl






