runnerjp Posted April 25, 2008 Share Posted April 25, 2008 hey guys is there away of changing the colour depending on the sex sooo i use <?php echo $pgender;?> to show the gender Male or Female but if female show it in pink or if male the text be in blue is this possible?? Link to comment https://forums.phpfreaks.com/topic/102919-solved-chnage-colour-depending-on-gender/ Share on other sites More sharing options...
DarkWater Posted April 25, 2008 Share Posted April 25, 2008 $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). Link to comment https://forums.phpfreaks.com/topic/102919-solved-chnage-colour-depending-on-gender/#findComment-527206 Share on other sites More sharing options...
runnerjp Posted April 25, 2008 Author Share Posted April 25, 2008 haha that works great ty Link to comment https://forums.phpfreaks.com/topic/102919-solved-chnage-colour-depending-on-gender/#findComment-527209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.