[SOLVED]suggest proper conditional statement to fade tabs with CSS via PHP

rick007

New Member
i want to change class of two tabs via PHP, but stuck in basic condition.here is my codeCSS\[code\].myinfo { background-color:black }.deactive { background-color : white } \[/code\]HTML\[code\]<li class="myinfo <?=$deact?>"> <a href="http://stackoverflow.com/questions/5676467/myaccount.php?<?=$qry_str?>" >My Info</a></li><li class="myinfo <?=$deact?>"> <a href="http://stackoverflow.com/questions/5676467/myaccount.php?mycontacts&<?=$qry_str?>">My Contacts</a></li>\[/code\]what i need is\[quote\] if \[code\]$_GET['mycontacts']\[/code\] is active
then My Info link should have class \[code\]deactive\[/code\]
otherwise My Contacs link should have class \[code\]deactive\[/code\]\[/quote\]i tried below\[code\]if (isset($_GET['mycontacts'])){ $deact ='deactive';}\[/code\]but not succeed :(...please help to write condition ( i think one line \[code\]ternary condition\[/code\] can works )Solution\[code\]if (isset($_GET['mycontacts'])){ $info_class = 'deactive';}else { $acc_class = 'deactive';}\[/code\]and write \[code\]<li class="myinfo <?=$info_class?>">and<li class="mycontacts <?=$acc_class ?>">\[/code\]Thanks for helping_K
 
Top