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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

included file not working

Status
Not open for further replies.

madcgimonk

Programmer
Oct 8, 2004
25
US
I have a contact.html file thats supposed to include my CGI form.
Code:
<!--#include file="cgi-bin/contact.cgi"-->

But it's not including it. In the source code I see that exact line of code.

Why is the source code showing up for the include line? It sort of worked before I messed something up, but not sure what. Is there a way to include files without having to use a .shtml file?

Thanks
 
Firstly, the include is showing in the source because the page is not being parsed for SSI. You need to tell the server that it should parse the file, hence the normal .shtml extension.

How you change it to allow other files for SSI depends on the server/version you are using. If you tell us the server/version then we will be able to help.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I didn't want to use the .shtml ext for my site either, so I have both IIS and Apache on Linux set to parse .html and .htm ext so that all of my includes work.

Let me know if you need a quick walkthrough.
 
Not that I am familiar with includes, but could you set up Apache to parse .html files, and write files without includes as .htm?

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Not that I am familiar with includes, but could you set up Apache to parse .html files, and write files without includes as .htm?

Yes, but most people change the extension so that they do not need different extensions for either type of file. In your scenario, they would just be as easy to code it using shtml and html.

Another thing to note is using either html or htm for SSI can cause a lot of problems if you move to another server further down the line that does not allow you to configure the types parsed for SSI.

Overall though, you can parse any extension for any language, it just depends on how you setup the server.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
madcgimonk:

Why don't you want to use .shtml?

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top