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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.