View Full Version : Help with Output colors for Forms

10-20-2012, 05:29 AM
Hey guys,
I need a little help here. For some reason, I can't get the font color of the input as red. Here's what I have so far:

The initial input page:

<meta http-equiv="Content-Type" content="text/html">
<title>Data Input</title>


<body bgcolor="white">
<form style="color:red" action="function.php" method="GET">
<br> Input any word or phrase:
<input size="big" type="text" name="word" value="">
<br><input type ="submit" value="submit">
<br><a href="index.php">Home</a>

The output page: (I want only what the user input is to be red)

<meta http-equiv="Content-Type" content="text/html">
print "<h1>You have input: ";
if (isset($_GET['word']))
echo strtoupper($_GET['word']);


Any ideas?

10-20-2012, 06:02 AM
echo "<span style='color:#ff0000;'>".strtoupper($_GET['word'])."</span>";

10-20-2012, 06:21 AM
Thanks for your help! :)

Do you know of a way to get it to work by implementing it into the 1st code rather than the 2nd code?

10-20-2012, 06:31 AM
Add your style tag to the input tag instead of the form.