I'm told to do this
If the user has entered both names and checked a radio button, show a greeting Hello <firstname> <lastname>
. Change the background color of the Web page to the selected color. You do this by using the echo statement as follows:
echo "<body bgcolor =\” $color\”> Hello $firstname $lastname";
and my other php file I have
elseif(!(empty($_GET["fname"])) && (!(empty($_GET["lname"]))) && ($_GET["bgcolor"] == "red"))
{
echo "<body bgcolor='red'>" . "Hello " . $_GET["fname"] . " ". $_GET["lname"] . "!<br/>" . "Background color changed to the selected color";
}
is it possible if I put the the $_GET["bgcolor"]
's value into the <body bgcolor=''>
? so I don't have to use another elseif
statement...
because seeing this
echo "<body bgcolor =\” $color\”> Hello $firstname $lastname";
lets me think it's possible but if with just one variable $color
how is that possible O.o