Jump to content

Set Nav Help Please


Travist6983

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/116599-set-nav-help-please/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/116599-set-nav-help-please/#findComment-599597
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.