hoodlumpr Posted February 5, 2008 Share Posted February 5, 2008 I am using the following line of code for my navigation to set the active state for the active page. <li><a href="marketing.php"<?php if ($thisCase=="Marketing") echo " class=\"active\""; ?>>Stratigic Marketing</a></li> It works fine but I need to set it to have a different class if $thisCase doesnt have the value of Marketing....if tried a few things to no avail....can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/89603-solved-need-help-setting-else-in-statement/ Share on other sites More sharing options...
laffin Posted February 5, 2008 Share Posted February 5, 2008 <li><a href="marketing.php" class="<?=(($thisCase=="Marketing")?"active":"inactive");?>">Stratigic Marketing</a></li> Quote Link to comment https://forums.phpfreaks.com/topic/89603-solved-need-help-setting-else-in-statement/#findComment-459064 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.