Page 1 of 1

changing color using PHP

Posted: Sun Feb 09, 2003 7:34 pm
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");

Posted: Sun Feb 09, 2003 7:37 pm
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