Travist6983 Posted July 25, 2008 Share Posted July 25, 2008 Ok so i am sooo confused on my code where am i going wrong <div class="navBarItem" <?php if( $setNav != "faq" ) echo "onMouseOver=\"this.className='navBarItemHover';\" onMouseOut=\"this.className='navBarItem';\"";?>><a href="faq.php">FAQ</a><br> <?php if( $setNav == "faq" ) { echo " <a href='faq.php'>Gown Shopping</a><br>"; echo " <a href='faq2.php'>The Appointment</a><br>"; echo " <a href='faq3.php'>Ordering the Gown</a><br>"; echo " <a href='faq4.php'>Fittings & Alterations</a><br>"; echo " <a href='faq5.php'>Other Services</a><br>"; } ?> </div> there is my code but it is saying undefiend variable but there are defiend arent they i am trying to get it so when you click on Faq it will then make my menu bigger with sub catagorize under faq any help would be greatly appreciated Quote Link to comment Share on other sites More sharing options...
MFHJoe Posted July 25, 2008 Share Posted July 25, 2008 The reason you're getting undefined variable errors is because you're asking if $setNav doesn't equal "faq". If, further up in the script, you had made $setNav equal something (for example, $setNav = "nav"), then you wouldn't be getting these errors. What you need to do is add an isset to your if statement. if( isset($setNav) && $setNav == "faq" ) Now it asks: If $setNav exists AND it equals "faq" which should get rid of the undefined variable errors. Although, even so, I'm still not sure your script will work like you want it to. Try out the if statement first though. Quote Link to comment Share on other sites More sharing options...
LemonInflux Posted July 25, 2008 Share Posted July 25, 2008 Show us the whole page code, and put it in [php][/php] tags ---------------- Now playing: Red Hot Chili Peppers - Savior via FoxyTunes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.