LifeinAsia

msg:4114455 | 5:46 pm on Apr 12, 2010 (gmt 0) |
I think you need to use index.shtml The .shtml alerts your web server to parse that file differently than static HTML files. Unless you have another include in the included file, you probably want to use: <!--#include virtual="includes/nav.html"-->
|
MichaelBluejay

msg:4114870 | 7:11 am on Apr 13, 2010 (gmt 0) |
Yes, you have the html/shtml backwards. .shtml is for the calling page, .html is for the called page. Actually, the called page can have whatever extension you want. I typically use .ssi, for example. Also, if you put this code into your .htaccess file, then it doesn't matter whether your pages end with .shtml or .html: AddHandler server-parsed .html All of the above works for Apache web servers, but I assume it'll work for Windows, too.
|
rocknbil

msg:4115284 | 6:27 pm on Apr 13, 2010 (gmt 0) |
The included file can be pretty much anything. <strong>However, the space before --> is extremely important.</strong> <!--#include virtual="includes/nav.html" --> (in this case) <!--#include virtual="includes/nav.txt" --> <img src="<!--#include virtual="/images/some-image.gif" -->" alt="img"> <!--#include virtual="/cgi-bin/some-script.cgi" -->
|
MichaelBluejay

msg:4115443 | 12:37 am on Apr 14, 2010 (gmt 0) |
What's important about the space before the "-->"? I've never included that space, and I've never had any problems...that I know of.
|
rocknbil

msg:4115903 | 6:58 pm on Apr 14, 2010 (gmt 0) |
I can't even remember, all I recall is battling it one day and the space was what fixed it. One of those things you learn and forget about **why.** Closest I found was this [w3u.net], (mods, nix the link if inappropriate) in reference to using echo: | When you forget to leave a space before the closing SSI command HTML tag (-->), or when you add a space between the hash sign (#) and the SSI command (<!--# echo), nothing works, and you get that silly and ever-so-helpful error message ["an error occurred while processing this directive"]. |
| If you note all the examples [httpd.apache.org], they have spaces.
|
MichaelBluejay

msg:4116948 | 3:49 pm on Apr 16, 2010 (gmt 0) |
Okay. But it's worked for me 100% of the time without the space, for years, so I think I'll likely keep doing it that way.
|
kaled

msg:4117174 | 1:37 am on Apr 17, 2010 (gmt 0) |
The space may be optional on some systems and mandatory on others. Since it is harmless, it's probably best to include it. Kaled.
|
tedster

msg:4117362 | 4:20 pm on Apr 17, 2010 (gmt 0) |
kaled nails it -- there are lots of technical areas where many systems now recover from common errors, but it's still best not to make them in the first place.
|
|