how to add header and footer to many html files ?

Discussion in 'PHP' started by brokensoft, Dec 26, 2006.

  1. #1
    i have more than 3000 .html files, i want to add header and footer
    to all files.
    how could i ??
     
    brokensoft, Dec 26, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Create a php page with the header and footer, and in the middle use include() to insert the file you want to display.

    
    
    <html>
    <head>
    </head>
    
    <body>
    
    <div id="header"></div>
    
    <div id="main"><?php include('file.html'); ?></div>
    
    </div id="footer"></div>
    
    </body>
    </html>
    
    Code (markup):
     
    nico_swd, Dec 27, 2006 IP
  3. brokensoft

    brokensoft Active Member

    Messages:
    214
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    thank you i try that but when i click any internal link i get it without header or footer
     
    brokensoft, Dec 27, 2006 IP
  4. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    your should enable php parsing of the html pages
     
    maiahost, Dec 27, 2006 IP