Jump to content

[SOLVED] chnage colour depending on gender


runnerjp

Recommended Posts

$fontcolor = ($pgender == "Male") ? "6644FF" : "FF77AA";

echo '<font color="#' . $fontcolor .'">' . $pgender . '</font>';

 

Try that.

 

Woops, I had a little typo.  I just tried it on my server and it works as long as $pgender is "Male" or "Female" (first letter is capital).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.