Re: problem with form variables

From: Date: Fri, 01 Feb 2002 14:31:04 +0000
Subject: Re: problem with form variables
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-5896@lists.php.net to get a copy of this message
Ok, I should have read php.ini information. The first paragraph notifies: "...Instead of using $foo, you must use $_REQUEST["foo"]..." Now it´s working. Thanks! ----- Original Message ----- From: <Jeffrey_N_Dyke@Keane.com> To: "Laura Silveira Mastella" <mastella@inf.ufrgs.br> Sent: Friday, February 01, 2002 9:59 AM Subject: Re: [PHP-INST] problem with form variables > > this can probably be fixed in your php.ini. to test whether this is true > or not, try to grab the varaiblas as HTTP_POST_VARS['name'] and > HTTP_POST_VARS['age']. if php recognized the variables that way all can be > fixed in the ini. I thought as of 4.06 it was installed that way be > default, but i guess not. Unfortuantely i forget the setting.... > > Hope this helps. > Jeff > > > > "Laura Silveira > Mastella" To: <php-install@lists.php.net> > <mastella@inf.ufr cc: > gs.br> Subject: [PHP-INST] problem with form variables > > 02/01/2002 09:27 > AM > > > > > > > Well, now PHP is being parsed, but I have a problem with variables: they > are > not being automatically set by PHP. > > I have created a very simple html form (copied from php.net) > > index.html > ----------------------------------------------- > <form action="action.php" method="post"> > Your name: <input type="text" name="name"> > You age: <input type="text" name="age"> > <input type="submit"> > </form> > ----------------------------------------------- > > action.php > ----------------------------------------------- > Hi <?php echo $name; ?>. > You are <?php echo $age; ?> years old. > ----------------------------------------------- > > The result is (error messages activated): > -------------------------------------------------------------------------- -- > > ------------ > Hi > "Warning: Undefined variable: name in c:\apache > group\apache\htdocs\action.php on line 1" > You are > "Warning: Undefined variable: age in c:\apache > group\apache\htdocs\action.php on line 2" > years old. > -------------------------------------------------------------------------- -- > > ------------ > > I added <?php phpinfo(); ?> to action.php. The variables and their values > are there: > > _POST["name"] Laura > _POST["age"] 21 > > but, they are not recognized inside the PHP code. > > :( > > Laura > > > -- > PHP Install Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-install-unsubscribe@lists.php.net > For additional commands, e-mail: php-install-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.install (#5896) next »