You would be able to put another HTML header in all HTML pages if you set all of the HTML pages to use a single CSS file which contains the header data.
Well, it is possible if you put the PHP header into PHP pages. HTML pages can’t contain PHP.
Create one PHP file containing the header. It would be something like:
Upload this file onto your server as /include/header.php or something.
Then include this in all your PHP pages:
You could use “include” instead of “require_once”. They both include other PHP files. I use “require_once” because including the same file twice with “include” will cause a bug. It’s basically just a stupid syntax issue.
I do this on my website, though I use functions in my header.php to output different headers and various other things.
Go to . That banner at the top of most pages is created by the header file. I also set the background and text colors that way instead of using CSS.
The first thing you need to do is create you header file. Let’s call it “header.inc”
Inside this file write whatever HTML/CSS/JavaScript you want. You can even include PHP inside this file. Just make the extension “.inc”
Next you include the “header.inc” file on any and all pages you want displaying that header via:
This is saying you want to include the “header.inc” file and that it is in the root directory (i.e. the directory you want to store your “.inc” include files)
…
Interested in more PHP / HTML help?
Why not take a class with us @ DevelopIntelligence
Hope this helps,
Kamren
Software Technologist @ DevelopIntelligence
November 10th, 2007 at 12:14 am
Not possible.
You would be able to put another HTML header in all HTML pages if you set all of the HTML pages to use a single CSS file which contains the header data.
November 13th, 2007 at 11:30 am
This IS possible.
Well, it is possible if you put the PHP header into PHP pages. HTML pages can’t contain PHP.
Create one PHP file containing the header. It would be something like:
Upload this file onto your server as /include/header.php or something.
Then include this in all your PHP pages:
You could use “include” instead of “require_once”. They both include other PHP files. I use “require_once” because including the same file twice with “include” will cause a bug. It’s basically just a stupid syntax issue.
I do this on my website, though I use functions in my header.php to output different headers and various other things.
Go to . That banner at the top of most pages is created by the header file. I also set the background and text colors that way instead of using CSS.
November 14th, 2007 at 8:48 pm
The first thing you need to do is create you header file. Let’s call it “header.inc”
Inside this file write whatever HTML/CSS/JavaScript you want. You can even include PHP inside this file. Just make the extension “.inc”
Next you include the “header.inc” file on any and all pages you want displaying that header via:
This is saying you want to include the “header.inc” file and that it is in the root directory (i.e. the directory you want to store your “.inc” include files)
…
Interested in more PHP / HTML help?
Why not take a class with us @ DevelopIntelligence
Hope this helps,
Kamren
Software Technologist @ DevelopIntelligence