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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Location
    Ontario Canada
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Server Side Include doesn't show

    The site has a group of pages all with header, footer and left menu as server side includes, none of which is visible online.
    My son says the include isn't being translated into active code.

    I used Dreamweaver to do the insert

    Website scratchwizard.ca

    Pages affected reside in the paint code section of the site, the main pages of the site have had the server side replaced for now.
    Paint Code main Page

    Here is the code for 2 of the 3 includes for the linked page provided.
    <div id="container">
    <div id="header">
    <h1>
    <!--#include file="/Include/header.shtml" -->
    </h1>
    <!-- end #header --></div>
    <div id="sidebar1">
    <table width="100%" border="0" align="center">
    <tr>
    <th scope="row"><!--#include file="Include/2-Menu-Paint.shtml" --></th>
    </tr>
    </table>
    <p>
    </p>
    <!-- end #sidebar1 -->
    </div>
    ==================================
    Here is the code from the header
    <script type="text/javascript">
    <!--
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    <link href="../CSS/Level2_Arial_Text.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .BodyWhite {
    color: #FFF;
    font-size: 10px;
    }
    .BodyWhite .BodyWhite {
    font-size: 10px;
    }
    -->
    </style>
    <script type="text/javascript">
    <!--
    function MM_nbGroup(event, grpName) { //v6.0
    var i,img,nbArr,args=MM_nbGroup.arguments;
    if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
    img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
    if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
    nbArr[nbArr.length] = img;
    for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = args[i+1];
    nbArr[nbArr.length] = img;
    } }
    } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
    nbArr[nbArr.length] = img;
    }
    } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
    img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
    } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
    for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
    nbArr[nbArr.length] = img;
    } }
    }
    //-->
    </script>
    <body bgcolor="#000000" id="Header" onLoad="MM_preloadImages('../images/Buttons/About-Us-2.jpg','../images/Buttons/Local-Maps-2.jpg','../images/Buttons/Accommodations-2.jpg','../images/Buttons/Home-1.jpg','../images/Buttons/Home-2.jpg','../images/Buttons/About-Us-1.jpg','../images/Buttons/Lodging-1.jpg','../images/Buttons/Lodging-2.jpg','../images/Buttons/Ice-Conditions-1.jpg','../images/Buttons/Ice-Conditions-2.jpg','../images/Buttons/Local-Maps-1.jpg','../images/Buttons/Weather-1.jpg','../images/Buttons/Weather-2.jpg','../images/Buttons/Sponsors-1.jpg','../images/Buttons/Sponsors-2.jpg','../images/Buttons/Links-1.jpg','../images/Buttons/Links-2.jpg','../images/Buttons/Home-Down-80.png','../images/Buttons/Home-Up-80.png','../images/Buttons/Services-Down-80.png','../images/Buttons/Services-Up-80.png','../images/Buttons/Paint-Codes-Down.png','../images/Buttons/Paint-Codes-Up.png','../images/Buttons/Pics-Testimonials-Down-180.png','../images/Buttons/Pics-Testimonials-Up-180.png','../images/Buttons/Contact-Us-Down-90.png','../images/Buttons/Contact-Us-Up-90.png')">
    <table width="800">
    <tr>
    <th scope="col"><table width="800" border="0">
    <tr>
    <th width="34%" scope="col"><br>
    <table width="100%" border="0" align="center">
    <tr>
    <th scope="col"><br>
    <img src="../images/Scratch Wizard logo.jpg" width="229" height="71" alt="Scratch Wizard Permanent Scratch &amp; Chip Repair"><br>
    <span class="BodyWhite">Permanent Scratch &amp; Chip Paint Repair</span></th>
    </tr>
    </table></th>
    <th width="66%" scope="col"><table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td><a href="../index.html" target="_top" onClick="MM_nbGroup('down','group1','Home','../images/Buttons/Home-Down-80.png',1)" onMouseOver="MM_nbGroup('over','Home','../images/Buttons/Home-Down-80.png','../images/Buttons/Home-Up-80.png',1)" onMouseOut="MM_nbGroup('out')"><img src="../images/Buttons/Home-Up-80.png" alt="Scratch Wizard Permanent Paint & Chip paint Repair" name="Home" width="80" height="30" border="0" onload=""></a></td>
    <td align="left"><a href="../services.html" target="_top" onClick="MM_nbGroup('down','group1','Services','../images/Buttons/Services-Down-80.png',1)" onMouseOver="MM_nbGroup('over','Services','../images/Buttons/Services-Down-80.png','../images/Buttons/Services-Up-80.png',1)" onMouseOut="MM_nbGroup('out')"><img src="../images/Buttons/Services-Up-80.png" alt="Scratch Wizard Services" name="Services" width="80" height="30" border="0" onload=""></a></td>
    <td><a href="../paint-colours-dealerships.html" target="_top" onClick="MM_nbGroup('down','group1','Paint','../images/Buttons/Paint-Codes-Down.png',1)" onMouseOver="MM_nbGroup('over','Paint','../images/Buttons/Paint-Codes-Down.png','../images/Buttons/Paint-Codes-Up.png',1)" onMouseOut="MM_nbGroup('out')"><img name="Paint" src="../images/Buttons/Paint-Codes-Up.png" border="0" alt="Scratch Wizard Automotive Paint Codes" onLoad=""></a></td>
    <td><a href="../pictures.html" target="_top" onClick="MM_nbGroup('down','group1','Pictures','../images/Buttons/Pics-Testimonials-Down-180.png',1)" onMouseOver="MM_nbGroup('over','Pictures','../images/Buttons/Pics-Testimonials-Down-180.png','../images/Buttons/Pics-Testimonials-Up-180.png',1)" onMouseOut="MM_nbGroup('out')"><img src="../images/Buttons/Pics-Testimonials-Up-180.png" alt="Scratch Wizard custoper Testimonials" name="Pictures" width="180" height="30" border="0" onload=""></a></td>
    <td><a href="../contactus.html" target="_top" onClick="MM_nbGroup('down','group1','Contact','../images/Buttons/Contact-Us-Down-90.png',1)" onMouseOver="MM_nbGroup('over','Contact','../images/Buttons/Contact-Us-Down-90.png','../images/Buttons/Contact-Us-Up-90.png',1)" onMouseOut="MM_nbGroup('out')"><img src="../images/Buttons/Contact-Us-Up-90.png" alt="Scratch Wizard Contact Us" name="Contact" width="90" height="30" border="0" onload=""></a></td>
    </tr>
    </table></th>
    </tr>
    </table>
    <img src="../images/red-line.jpg" alt="Red Line" width="780" height="7"></th>
    </tr>
    </table>
    Hope someone can show me where I screwed up

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This doesn't have anything to do with Java. Moving from Java to Apache configurations.

    Your son is correct; the SSI is not being processed. You can see the include attempt in the source code. Note that by default when SSI is enabled it only processes pages with an .shtml extension to it. The page you have given is an .html page. Try saving it as a .shtml and see if it executes the include directive. Its been (literally) years since I've used an SSI, but I believe what you have here will work just fine.

    If it still doesn't work, you need to check two things in your httpd.conf for Apache. The first is that your options allow include (usually looks like Options +Include in a directory block), and that you have a type setup for server includes: AddHandler server-parsed .shtml. I believe both of these are default for httpd.conf file.

    Also, in the future please use [code] and [/code] tags to make your posted code more readable.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,993
    Thanks
    15
    Thanked 233 Times in 233 Posts
    /Include/header.shtml and Include/2-Menu-Paint.shtml, one has the slash in front, both have uppercase I, might want to check the folder name to see if it's lower case I. Also I think the included files could get by with a .txt extension since you want them to be read verbatim and not interpreted.

    PS: Fou-Lu is right. I can see it too now. Just changing to .shtml will likely fix it.
    Last edited by DrDOS; 10-31-2010 at 05:28 AM.

  • #4
    New to the CF scene
    Join Date
    Oct 2010
    Location
    Ontario Canada
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much for your response.
    I made the change to SHTML and all is well
    Sorry for Posting in the wrong area.


  •  

    Tags for this Thread

    Posting Permissions

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