Page 1 of 1

can't view web page if #include used

Posted: Wed Apr 12, 2006 8:57 pm
by lucieh
I'm very new to all of this, so please bear with me if I don't have the proper terminology down.

I'm using TextPad to edit my web pages (which were created for me by a professional designer). There are three #include lines at the beginning of the web page I'm editing. It appears as if the #include is commented out. There are <!-- and --> on each of these lines.

When I make my changes and select the "globe" icon -- meaning that I want to view the changes in my browser, the browser comes up but it only redisplays the HTML code... not the "real view".

So, are the #includes causing the problem or are the comments causing the problem?

I temporarily removed these three lines and the web page displayed correctly.

I'm afraid to remove this code --- I know, I know I need to talk with my designer... but in the meantime, how do I display the web page with these three lines in it.

Does something else need to be the first line on the page?
Thanks!
Lucie

Posted: Thu Apr 13, 2006 3:04 pm
by ninjalabs
The <!--#include ... --> section is a "server side include". This basically replaces a part of the HTML document with another one (allowing easy implementation of templates etc).

You need to use a web server to display these files in their complete form as the #include directive is processed on the server. Textpad or any browser using it will not be able to render it.