included footer does not show up

Discussion in 'HTML & Website Design' started by rushza, Apr 27, 2010.

  1. #1
    Hi there

    I have a question I would like some assistance with please.

    I am not a web guru but I'm not a total newby either but am willing to learn.

    I am trying to include an html page into another using ssi

    I have index.php

    The code looks like this :

    
    <html>
    <head>
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body class="style">
    
    <div id="container">
      <div id="header">
        <h1>Header</h1>
      <!-- end #header --></div>
      <div id="mainContent">
        <h1> Main Content</h1>
        <p>Lorem ipsum </p>
        <h2>H2 level heading </h2>
        <p>Lorem ipsum</p>	
    <!-- end #mainContent --></div>
      
        
        
          <!--#include file="includes/footer.shtml" -->
    
    
    HTML:
    the footer.shtml looks like this
    
    
    <div id="footer">
    <p>This is a test</p>
    </div>
    </div>
    </body>
    </html>
    
    
    HTML:
    so the footer contains all the closing tags

    But nothing shows up ?

    I have tried renaming the footer to footer.php , footer.html

    Nothing works.

    Any ideas?

    oh and php does work, if I run a phpinfo() I get the configuration settings page
     
    rushza, Apr 27, 2010 IP
  2. mps705

    mps705 Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1. Rename footer.shtml to footer.php.

    2. Change

    <!--#include file="includes/footer.shtml" -->
    Code (markup):
    to

    <?php include_once('includes/footer.php'); ?>
    Code (markup):
     
    mps705, Apr 27, 2010 IP
  3. majin22

    majin22 Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i believe you can skip the first step but yes, you need to change the include code to <?php include file="includes/footer.shtml"; ?>
     
    majin22, Apr 27, 2010 IP