wanna include footer.txt in html

Discussion in 'HTML & Website Design' started by westhaven, May 8, 2005.

  1. #1
    wanna include footer.txt in html pages
    i don know the exact syntax it was like <#include...i don remember it
    can anyone tell me the exact syntax for it
     
    westhaven, May 8, 2005 IP
  2. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cannot include other files into HTML pages. They have tp be parsed and the correct way to parse them is renaming them to SHTM or SHTML. If you are on a *NIX server, you can tell the server to parse all HTML pages, but this puts un-do load on your servers.

    The code could be:
    <!--#include file="footer.txt" -->
    Code (markup):
    or
    <!--#include virtual="../footer.txt" -->
    Code (markup):
    Make sure you do not put in your <head> or <body> tags since these will be pulled from the main page.
     
    Corey Bryant, May 8, 2005 IP
  3. NewComputer

    NewComputer Well-Known Member

    Messages:
    2,021
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    188
    #3
    Why not just use php and include the text?
     
    NewComputer, May 8, 2005 IP
  4. honey

    honey Prominent Member

    Messages:
    15,555
    Likes Received:
    712
    Best Answers:
    0
    Trophy Points:
    325
    #4
    yes, include as PHP, and set in your .htaccess the document type for HTM and HTML to be PHP, so that all HTML files are parsed as php documents.
     
    honey, May 8, 2005 IP
  5. NewComputer

    NewComputer Well-Known Member

    Messages:
    2,021
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    188
    #5
    honey,

    can you provide the .htaccess code necessary to do that?
     
    NewComputer, May 8, 2005 IP
  6. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Per Running PHP on a html or htm page
    AddType application/x-httpd-php .html .php .htm
    Code (markup):
    But I still do not recommend this as it can slow your site & increase the load on the server. I only work on Windows - but you might have to restart Apache as well for this to take effect
     
    Corey Bryant, May 8, 2005 IP
  7. cyberman2046

    cyberman2046 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Assume this file is index.htm:


    <td class="footercenter" width="800" height="78">
    <!--webbot bot="Include" u-include="include_footer.htm" tag="BODY" startspan -->

    <a href='index.htm'><font face='Arial Unicode MS'>Home </font></a>

    (content of include_footer.htm file)

    <!--webbot bot="Include" i-checksum="57741" endspan --></td>


    Remarks: Use Frontpage to edit file include_footer.htm. And then open index.htm in Frontpage environment and it should already updated with the changes made in include_footer.htm(if any). Now just save index.htm.
    ftp both files to a web server. If you have many pages using this footer info, now you can just update the footer file instead of saving all the trouble to update each file(which has the footer info written in the conventional way).
     
    cyberman2046, Jul 11, 2008 IP