Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    don
    don is offline
    New Coder
    Join Date
    Sep 2002
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    #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?

    =============

    <!--#include virtual="header.htm"-->
    <!--#include virtual="navbar1.htm"-->

    HTML Text Goes Here

    <!--#include virtual="navbar2.htm"-->
    <!--#include virtual="footer.htm"-->

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    are you sure that your host supports SSI? also, can we see the page that this is on?
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    self.location
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, some servers require a space between the double quotes and the second comment tag: " -->

  • #5
    New Coder
    Join Date
    Oct 2002
    Location
    Ohio
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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).

  • #6
    don
    don is offline
    New Coder
    Join Date
    Sep 2002
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Duniyadnd


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •