I'm new to this site and VERY new to HTML/PHP so pardon me if I do anything wrong... but here's my question:
I just started learning HTML through many Google searches. 2 weeks ago I had never touched HTML in my life. I'm building a site with 6 main pages: Home, Questions, Forums, Contact, About
, and Help
.
Each page has 4 main components:
Header (including horizontal navbar)
Sidebar
Main Content Area
Footer
The Header, Sidebar, and Footer are replicated on each page using the PHP INCLUDE command. This works great. Everything is working fine.
However, I don't exactly want the Header/Navbar to be 100% identical on each page. In my Header.HTML file (the file that is called upon by my PHP INCLUDE command) contains a DIV I rightfully called "headertext".
For example, on the home page, my headertext DIV says "Cool Stuff, Free of Charge!" (visually styled with CSS, but the text information is contained within the Header.HTML file) and it's centered nicely between the website logo and the website ad box, all within the Header area.
Since I'm using PHP INCLUDE, EVERY page on the site has this same line of text in the header. However... here's what I want:
When I navigate to my "ABOUT" page for example, I want the headertext div to become "ABOUT US" instead of "Cool Stuff, Free of Charge".. Get what I'm saying?
But I still want to use PHP INCLUDE to minimize the amount of code I have to sift through for each page's index.php file...
I hope all of this made sense.... While I am a newbie to this stuff, I've grown to become pretty good at HTML over the past 2 weeks. However, please note that I am brand new to PHP (as of today). So is this possible?
Thanks for any help!
UPDATE: SOLVED:
Thanks to Kainaw, I figured it out.