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? 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> 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
Archived
This topic is now archived and is closed to further replies.