Verification: a143cc29221c9be0

Php code for background colour


Change Div Background Colour Dependent On Php Variable

View Content


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.

Code: [Select]


  • status . "\n";?>

  •                 status=="RED") echo "Red info"; ?>
                    status=="GREEN") echo "Green info"; ?>
                    status=="BLUE") echo "Blue info"; ?>
    status=="YELLOW") echo "Yellow info"; ?>