+ Reply to Thread
Results 1 to 5 of 5

Thread: html footer wrapper

  1. #1
    kieran_mullen Guest

    Default html footer wrapper

    to get a footer on every html page would it be better to use a htaccess file or amod rewrite? if so how? I have seen turoials on how to use it for including php pages on php pages but not html with html

    thanks!

  2. #2
    Join Date
    Jul 2008
    Posts
    4

    Default

    Well would it not make more sense to make an includes files? when you have designed your pages in html I think it's always better to save as .php.

    so make your includes file and call it footer.php and stick that in an includes folder.

    Lets for example use a basic footer.

    <table align="center" style="margin-top:10px; margin-bottom:20px;">
    <tr>
    <td>Copyright divisions post example All Rights Reserved &copy; 2008. Registered </td>
    </tr>
    </table>
    Thats a basic footer design, in a simple table, anyway thats your includes file, now on the page you wish to add this to, all you need to do is link to this page with a footer tag.

    Example.
    <?php include("../includes/footer.php"); ?>
    and that will show on every page you add that to

  3. #3
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    You can add a line to your .htaccess to have it parse .htm or .html for PHP if you have includes in all your pages.

    Don't use tables like that as that is not tabular data and so doesn't belong in a table (that method was the 20th century way of setting out pages before style sheets were introduced 10 years ago. Place the footer in a div and style it from your style sheet.

  4. #4
    Join Date
    Apr 2008
    Location
    Morgan Hill, CA
    Posts
    361

    Default

    Quote Originally Posted by felgall View Post
    You can add a line to your .htaccess to have it parse .htm or .html for PHP if you have includes in all your pages.
    What is the line that would you add to your .htaccess file?

    Would that also apply if you only had PHP code in some of your files or would doing that cause other problems?

  5. #5
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    Adding the line when only some of your pages have PHP in them would slow down all the pure HTML pages unnecessarily as the PHP parser would need to examine every line of those files looking for PHP before delivering them to the browser. If you are only using PHP on some pages then you are better off to just use a .php extension for those pages.

    If you do use PHP in all your .html pages then the following lines in the .htaccess will handle it.

    Code:
    AddType application/x-httpd-php .html
    AddHandler application/x-httpd-php .html

+ Reply to 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