Re: Help please: Unable to get $_POST["variable"]; to work in a form.

From: Date: Tue, 10 Dec 2002 18:06:31 +0000
Subject: Re: Help please: Unable to get $_POST["variable"]; to work in a form.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-127684@lists.php.net to get a copy of this message
This is the exact code in the HTML file: <html> <head> <title>PHP Form Example</title> </head> <body> <form action="action.php" mehtod="POST"> Your name: <input type="text" name="name" /> Your age: <input type="text" name="age" /> <input type="submit"> </form> </body> </html> I believe that is using the method POST. If there is something wrong in the HTML file, or if you have any other suggestions, then please let me know. "Hacook" <hacook@free.fr> wrote in message news:20021210171121.19266.qmail@pb1.pair.com... > Make sure your form is sent through the method="POST" > > "David Scott" <dedoleo@hotmail.com> a écrit dans le message de news: > 20021210165617.2237.qmail@pb1.pair.com... > > I am going through the introductory tutorial on > > http://www.php.net/ and am > > stuck on this page: > > http://www.php.net/manual/en/tutorial.forms.php > > > > I have been able to get all of the examples up to this point to work. > > > > The form is simple: it asks for a text "name", a text "age" and has a > submit > > button. The information is submitted to action.php. > > > > Action.php contains this code: > > Hi <?php echo $_POST["name"]; ?>. > > You are <?php echo $_POST["age"]; ?> years old. > > > > I saved action.php as a text file with only the information above. > > > > When I enter JoeBob into the name field and 27 into the age field, I get > > this for output: > > Hi > > Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 > > . You are > > Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 > > years old. > > > > What can I do to remedy this? > > > > > >

« previous php.general (#127684) next »