Change Div background Colour dependent on PHP variable
-
Hi,
I have looked everywhere for a way to do this and would be grateful for a pointer in the right direction.
I want to change the background color of the div with the id of “loggedin”, depending on the status. The status currently echos text depending on the value.
<div class="grid_12" id="loggedin"> <div> <ul id="loggedin"> <li><?php global $current_user; get_currentuserinfo(); echo 'Status : ' . $current_user->status . "\n";?></li> <li> <?php if ($current_user->status=="RED") echo "Red info"; ?> <?php if ($current_user->status=="GREEN") echo "Green info"; ?> <?php if ($current_user->status=="BLUE") echo "Blue info"; ?> <?php if ($current_user->status=="YELLOW") echo "Yellow info"; ?> </li> </div> </div>Thanks
The topic ‘Change Div background Colour dependent on PHP variable’ is closed to new replies.