re: undefined variable
| From: | tracker1 | Date: | Mon, 16 Sep 2002 06:09:59 +0000 |
| Subject: | re: undefined variable | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-general+get-116488@lists.php.net to get a copy of this message | ||
try $_POST['ElementName']
New B wrote:
> I am a beginner of PHP, and need help on PHP variable issue:
>
> I made an HTML form:
>
> ...
> <FORM ACTION="HandleForm.php" METHOD=POST>
> First Name <INPUT TYPE=TEXT NAME="FirstName" SIZE=20><BR>
> Last Name <INPUT TYPE=TEXT NAME="LastName" SIZE=40><BR>
> E-mail Address <INPUT TYPE=TEXT NAME="Email" SIZE=60><BR>
> Comments <TEXTAREA NAME="Comments" ROWS=5 COLS=40></TEXTAREA><BR>
> <INPUT TYPE=SUBMIT NAME=SUBMIT VALUE="Submit!">
> <INPUT TYPE=RESET NAME=RESET VALUE="Reset">
> </FORM>
> ...
>
> and I try to use a PHP page to retrieve data out:
>
> ...
> <BODY>
> <?php
> /* This page receives and handles the data generated by "form.html". */
> print "Your first name is $FirstName.<BR>\n";
> print "Your last name is $LastName.<BR>\n";
> print "Your E-mail addres is $Email.<BR>\n";
> print "This is what you had to say:<BR>\n $Comments<BR>\n";
> ?>
> </BODY>
> ...
>
> I end up getting error:
>
> Notice: Undefined variable: FirstName in \HandleForm.php on line 7
> Your first name is .
>
> Notice: Undefined variable: LastName in \HandleForm.php on line 8
> Your last name is .
>
> Notice: Undefined variable: Email in \HandleForm.php on line 9
> Your E-mail addres is .
>
> Notice: Undefined variable: Comments in \HandleForm.php on line 10
> This is what you had to say:
>
> Is it something wrong with my coding, IIS setup or PHP installation?
--
-----------------------------------------------------------------------
Michael J. Ryan | ICQ: 4935386
tracker1(at)theroughnecks(dot)net | AIM/AOL: azTracker1
Roughneck BBS: | Yahoo: azTracker1
http://www.theroughnecks.net | MSN:
(email address)
telnet://theroughnecks.net | Trillian: www.trillian.cc
--- Synchronet 3.10j-Win32 NewsLink 1.30
* Roughneck BBS - www.theroughnecks.net - telnet://theroughnecks.net