View Full Version : #include problems
I am trying to create a framework to be included into each of my web pages so that I can make it a bit more modular. I use the following lines and they display fine in DreamWeaver, but when I post them to my hosted web site they don't work.
I've tried putting <html> and </html> outside the include files and still no luck.
1) is this a good idea to do it this way?
2) what am I doing wrong?
HTML Text Goes Here
11-19-2002, 08:32 PM
are you sure that your host supports SSI? also, can we see the page that this is on?
11-19-2002, 10:57 PM
joh6nn asks a valid question. Also Don, if SSI is supported, your server might additionally require that all files containing the include directive use the .shtml extension (rather than simply .html ).
The extension is used as a "flag" to tell the server to LOOK inside the file for any directives... otherwise the server sends the page without parsing the contents.
Some servers support SSI without requiring the extension though, and these servers operate slightly more slowly than they otherwise would, because they spend time parsing the contents of every page whether or not any directives are present.
11-20-2002, 09:43 AM
Also, some servers require a space between the double quotes and the second comment tag: " -->
11-20-2002, 09:46 PM
Not sure if this is a problem, but those files (header, navbar, etc.) would have to be in the same directory (folder) as the page you're loading.
Here's a way to get around that.
If the files are in the root of your web, do this...
<!-- #Include VIRTUAL="/header.htm" -->
The "/" tells the page to start looking for the page from the root directory. Without it, it looks only in the current directory. This is the safest way to include a file since it will work from anywhere in your site.
Likewise, if they were a folder deep in your web, it might look like this...
<!-- #Include VIRTUAL="/includes/header.htm" -->
Again, not sure if this is an issue, but it was a problem I have gone through with one of my own sites.
And like realisis said, you'll have to have a page extension of .shtm, .asp or .jsp (others may work... these I know of).
I am still having problems. They may be due to my web hoster, web.com. I am trying to get the simplest of PHP scripts to work, too. I'm starting to think there is something wrong with their web server.
I'll post back when I know more.
11-21-2002, 04:28 AM
I checked out web.com and it seems that in the "Unix Value Hosting" they do not support SSIs nor PHP Scripts. In the "Unix E-Silver Hosting" they do support SSIs however.
I'm presuming this is the case, because they fail to mention either in any deal below the Unix E-Silver Hosting, yet they don't fail to mention that they offer SSIs in some offers.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.