ok heres one for you, php include

Joined
12 Feb 2006
Posts
17,680
Location
Surrey
ok so i can do php include and all that, but i would like to know, is when say including the navigation links, on the page i currently am on i tend to have it a differnet looking button/link as much places, but how would i do that with php include?

like with latest site i made, navButtonOn (current page), and navButtonOff (all other pages), how would i say include nav.html, then change contact navigation button to be on etc?
 
Have php in your include to check current location and output the HTML accordingly :)

if im reading what you have said correclty not really sure how that would work with what i have done.

this is roughly what i have,

Code:
<div id="navButtonOff"><a href="index.html">Home</a></div>
<div id="navButtonOff"><a href="about.html">Home</a></div>
<div id="navButtonOff"><a href="services.html">Home</a></div>
<div id="navButtonOff"><a href="contact.html">Home</a></div>
so how would the php check say ok we are on index.html, so change the div around index.html to navButtonOn?

actually thinking about it i should probably change the <a> to use the id so its easier to change and get rid of the <div> all together, but still how would i get it to change it? was thinking could check filename and then change the link with the filename that matches but troulbe is like with the services, you go to services page and then from there could go to domestic, commercial, but still want the services nav button to be on.
 
Last edited:
Back
Top Bottom