SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to embed a file that updates on every page?

    How do you embed footer links into every webpage? So that I can update one file and it fixes the footer on every webpage?

    I know how to do it by using PHP files but I don't want to use that. I don't want every page to be xxxx.php

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    The method you want is called server-side includes, there's only two ways to achieve it... either you use a server-side language (PHP, ASP, ColdFusion, JSP, etc) or you use shtml (yes you would need to rename the file extension unless you can change the MIME types for your server).

    http://en.wikipedia.org/wiki/Server_Side_Includes
    http://www.sitepoint.com/forums/show....php?p=4407517

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2009
    Location
    South Carolina
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hockmasm View Post
    I know how to do it by using PHP files but I don't want to use that. I don't want every page to be xxxx.php
    Why do you not want your pages ending with a php extension? Most folks don't even notice or understand the difference between the different extensions.

    Use what you know and understand. If you know PHP, then you know using it will save you time and eliminate headaches in the future.
    Each day is a learning experience.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,607
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    If you don't want to change the extension names because you are updating all the pages on your site then you can add entries into your .htaccess file to tell the server to parse your .html or .htm files for either SSI or PHP.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,608
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    A PHP include is the best way to go. And as Stephen says, you can leave your pages with a .html extension by modifying the .htaccess file. In case it's of use, I recently posted a simple How-To on this.


Bookmarks

Posting Permissions

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