Re: What's wrong with these two programs?
| From: | Michael Purdy | Date: | Tue, 23 Nov 2004 05:15:49 +0000 |
| Subject: | Re: What's wrong with these two programs? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25028@lists.php.net to get a copy of this message | ||
Anthony
Assuming you have not omitted any of the code for script 2:
You need to have a get the posted value at the start of script 2 i.e.
$username = $_REQUEST['userName'];
Mike
----- Original Message -----
From: "aomarlow" <aomarlow@yahoo.com>
To: <php-windows@lists.php.net>
Sent: Tuesday, November 23, 2004 1:36 PM
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
>