Hi there I am trying to use PHP include for the menu. However, the menu navigation will have an extra class added each time a user links to that page. Example: Homepage <ul> <li><a href="home" title="Home" [B][COLOR="red"]class="home active"[/COLOR][/B]>Home</a></li> <li><a href="about" title="About" class="about'>About</a></li> <li><a href="contact" title="Contact" class="contact'>Contact</a></li> </ul> Code (markup): Does anyone know how to implement the PHP include for the menu if I need to change the class to a different page? Example: Contactpage <ul> <li><a href="home" title="Home" class="home">Home</a></li> <li><a href="about" title="About" class="about'>About</a></li> <li><a href="contact" title="Contact" [B][COLOR="red"]class="contact active"[/COLOR][/B]>Contact</a></li> </ul> Code (markup): Many thanks in advance CHEERS
just before include, put this line or or depends on when you are and now include that menu. in that menu file, change that code to this hope it helps !
Excellent! Thank you very much G3n3s!s, it works. I got it working on my navigation and other areas of my website. I think I understand how var works now since I haven't used it before. This will be great for more heavier and complex website development. CHEERS
Too easy, much appreciated. Oops, I didn't think it will be this soon . I had a little problem with my catcha on my contact page not sure why it didn't work?? Example: Contactpage What do you reckon?
I think you are missing $publickey = "#"; $privatekey = "#"; it should be different. You get key from recaptcha website I think
Hello, Here is the PHP. <?php if($_SERVER['REQUEST_URI'] == "home"){ $class_addon1 = " active"; } else if($_SERVER['REQUEST_URI'] == "about"){ $class_addon2 = " active"; } else if($_SERVER['REQUEST_URI'] == "contact"){ $class_addon3 = " active"; } ?> PHP: Here is the HTML. <ul> <li><a href="home" title="Home" class="home<?=$class_addon1?>">Home</a></li> <li><a href="about" title="About" class="home<?=$class_addon2?>">About</a></li> <li><a href="contact" title="Contact" class="home<?=$class_addon3?>">Contact</a></li> </ul> HTML: I hope i helped. Thanks, Michael
you're missing recaptchalib.php in folder/home/name/public_html/php/ Mike, why are you replying when we already solved it yesterday?
I just found out, PHP and HTML don't mix very well . I might have to find another way of getting this to work. Was doing some research and found Smarty template engine. If worse case, I might have to learn how to use Smarty and build all my sites from there if necessary.
I don't like to set here and read ALL the posts, just post my solution. Sorry if it was already solved. Thanks, Michael
FREEEDOOM!! I have finally got it working Gen, flip all that time I had the path wrong. Sweet, thanks again for your help Gen.