RE: [PHP-WIN] What's wrong with these two programs?
| From: | Armando | Date: | Tue, 23 Nov 2004 04:14:51 +0000 |
| Subject: | RE: [PHP-WIN] What's wrong with these two programs? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25027@lists.php.net to get a copy of this message | ||
Anthony, there is nothing wrong with what you've done, but try changing
your 'print' line in hiUser.php to:
print "<h3>Hi there, ". $_POST["userName"] ."</h3>";
And it should now work. Cheers.
Armando
-----Original Message-----
From: aomarlow [mailto:aomarlow@yahoo.com]
Sent: November 22, 2004 9:36 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] What's wrong with these two programs?
Hi,
Can anyone tell me what's wrong with the two following programs? The
first (whatsName.html) is straight HTML, and is supposed to build a form
that asks a question. The second program, (hiUser.php) is supposed to
read the value input by the user, and process it. I'm not having any
trouble with the first program, but when the second program runs, it
prints out code, rather than getting the result that it is supposed to
get.
Have I linked the two programs in the wrong way, or
something like that? BTW, both of these programs are
sample programs from the book, "PHP 5/MySQL
Programming for the Absolute Beginner."
Here are the two programs:
1.) whatsName.html:
<html>
<head>
<title>What's your name?</title>
</head>
<body>
<h1>What's your name?</h1>
<h3>Writing a form for user input</h3>
<form method = "post"
action = "hiUser.php">
Please type your name:
<input type = "text"
name = "userName"
value = "">
<br>
<input type = "submit">
</form>
</body>
</html>
Here is program #2.) hiUser.php:
<html>
<head>
<title>Hi User</title>
</head>
<body>
<h1>Hi User</h1>
<h3>PHP program that receives a value from
"whatsName"</h3>
<?
print "<h3>Hi there, $userName!</h3>";
?>
</body>
</html>
Your help is always appreciated!
Anthony
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php