Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2012, 04:29 AM   PM User | #1
ommoi
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
ommoi is an unknown quantity at this point
Help with Output colors for Forms

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:

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

</head>

<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">
</form>
<br><a href="index.php">Home</a>
</html>





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


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

?>
</body>
</html>



Any ideas?
ommoi is offline   Reply With Quote
Old 10-20-2012, 05:02 AM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
echo "<span style='color:#ff0000;'>".strtoupper($_GET['word'])."</span>";
mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
ommoi (10-20-2012)
Old 10-20-2012, 05:21 AM   PM User | #3
ommoi
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
ommoi is an unknown quantity at this point
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?
ommoi is offline   Reply With Quote
Old 10-20-2012, 05:31 AM   PM User | #4
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Add your style tag to the input tag instead of the form.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:32 AM.


Advertisement
Log in to turn off these ads.