View Full Version : Automatically adding header/footer to web pages
Rather than using frames or manually adding a header and footer to each page, how do I do so automatically? I assume I'd have to write some sort of script (I have no programing experience, other than HTML) and parse the pages through it?
Thanks in advance...
master7
04-29-02, 04:13 PM
Use PHP and insert this
Header:
<?php
include 'top.php';
?>
footer:
<?php
include 'bottom.php';
?>
and then make the files top.php and bottom.php and include whatever you want in them.
Then rename the file you edited to a .php file
Or you can use SSI
<!--include virtual="/path/to/file.txt"-->
then rename the file to .shtml or .shtm
Thanks for the reply, master7.
PHP doesn't work for me (the two commands are competely ignored). SSI does, however, only if I "preview" the page via the HTML editor I'm using (Dreamweaver 4).
PHP doesn't work for me (the two commands are competely ignored).
Correct. To view teh php in action you need to have a server installed locally with php version also installed or view the pages online at a host with php installed.
Originally posted by TonyT
or view the pages online at a host with php installed. Did that. Nothing loads. Just a blank page.
Originally posted by glc1
Did that. Nothing loads. Just a blank page. Scratch that, just got PHP working. Thanks guys.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.