changing color using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinkygal
Forum Newbie
Posts: 8
Joined: Tue Jan 21, 2003 7:54 am

changing color using PHP

Post by pinkygal »

hi, i have encountered problems when I want to change the color of the text that user has key in. Whenever I choose a color from the drop down menu and i click on submit, the color of the text will be white which is my default color otherwise it will be black. I couldnt seems to change the color to other color like red , blue etc. This is my code:

switch($fcolor){

case "Black":
$fcolor="#000000";
break;

case"Dark Grey":
$fcolor="#333333";
break;

case"Light Grey":
$fcolor="#999999");
break;

case "White":
$fcolor="#FFFFFF";
break;

case "Red":
$fcolor="#FF0000";
break;

case "Green":
$fcolor="#00FF00";
break;

case "Blue":
$fcolor="#0000FF";
break;

case "Yellow":
$fcolor="#FFFF00");
break;

case "Light Blue":
$fcolor="#00FFFF";
break;

case "Purple":
$fcolor="#FF00FF";
break;

default:
$fcolor="#FFFFFF";
break;
}
print("<div align=\"$Alignment\"><font size=\"$fsize\" face=\"$Fface\" color=\"$fcolor\">$Title");
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the browser really receives <div ...><font ... color="#FFFFFF"> ?
If so, Sticky: Before Post Read: Concerning Passing Variables in PHP 4.2+ might be of interest
Post Reply