0

I have moved my footer contents in my website to a separate file named footer.php as this repeats throughout all the pages.

footer.php

<?php
    echo "<footer class="footer">
              <div class="container">
                  <p class="text-muted"><a href="contactus.html">Contact Us</a></p>
                  <p class="text-muted"> Copyright &copy; <span id="yearfooter"> </span>. All rights reserved.</p>
              </div>
          </footer>";
?>

I have included the footer.php into my index.html using <?php include 'footer.php';?>

I have also created a .htaccess file with the following:

.htaccess

AddType application/x-httpd-php .html

But, the footer is not being displayed in my index.html page. When I inspect the index.html page using firebug, I can see the php include I've give commented <!--?php include 'footer.php';?-->. I did not comment it in my index.html file. This is my first day using php and appreciate any help.

UPDATE

footer.php

<?php
    echo '<footer class="footer">
              <div class="container">
                  <p class="text-muted"><a href="contactus.html">Contact Us</a></p>
                  <p class="text-muted"> Copyright &copy; <span id="yearfooter"> </span>. All rights reserved.</p>
              </div>
          </footer>';
?>

Update

I've managed to get this working. There was some config issues in my php5.conf file. Removed the config I added and its working great now.

Michelle Ashwini
  • 910
  • 2
  • 13
  • 28
  • 1
    If you insist to use double quote to enclose your HTML code, make sure you escape the double quote in HTML with backslash. – Raptor May 26 '16 at 09:17
  • You are trying to output a PHP Code from within a HTML File. Could that work? Either you remove the Entire PHP code in the footer or you change the index File to index.php. – Poiz May 26 '16 at 09:17

0 Answers0