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.
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:
< ?php
echo "a bunch of stuff for my header";
?>
Upload this file onto your server as /include/header.php or something.
Then include this in all your PHP pages:
< ?php
require_once getenv("DOCUMENT_ROOT")."/include/header...
//the rest of the page follows
?>
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 http://orbitalcows.com/ . 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:
< ? include("/header.inc"); ?>
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 http://developintelligence.com/catalog...
Hope this helps,
Kamren
Software Technologist @ DevelopIntelligence http://developintelligence.com
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.
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:
< ?php
echo "a bunch of stuff for my header";
?>
Upload this file onto your server as /include/header.php or something.
Then include this in all your PHP pages:
< ?php
require_once getenv("DOCUMENT_ROOT")."/include/header...
//the rest of the page follows
?>
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 http://orbitalcows.com/ . 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:
< ? include("/header.inc"); ?>
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
http://developintelligence.com/catalog...
Hope this helps,
Kamren
Software Technologist @ DevelopIntelligence
http://developintelligence.com