Re: variables not passing thru form

From: Date: Tue, 22 Oct 2002 18:09:18 +0000
Subject: Re: variables not passing thru form
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120957@lists.php.net to get a copy of this message
At the top of your script, execute: extract($_POST); this will create variables from the $_POST array with the same name as the form variables. Saves you from having to refer to variables as $_POST['varname'] ----- Original Message ----- From: "John W. Holmes" <holmes072000@charter.net> To: "'Davinder'" <lists@mahal.org>; <php-general@lists.php.net> Sent: Tuesday, October 22, 2002 11:41 AM Subject: RE: [PHP] variables not passing thru form This is probably a register_globals problem. It defaults to OFF with newer versions of PHP. You must use $_GET['name'] or $_POST['name'] (depending on your method) instead of just $name. It's advised you keep register_globals OFF and learn to program with the new arrays. The really are a lot easier when you get used to them. ---John Holmes... > -----Original Message----- > From: Davinder [mailto:lists@mahal.org] > Sent: Tuesday, October 22, 2002 12:34 PM > To: php-general@lists.php.net > Cc: Davinder > Subject: [PHP] variables not passing thru form > > Hi, > > I'm trying to do a simple form and just pass a few variables thru a > form to the next page. Its a simple concept however it just doesn't > want to work. I've tried using the post and get method.. neither work. > I've also taken code directly from some tutorials and even that doesn't > work. Is there something that i did to the php modules that dont allow > passing of variables? > > for example even this wont work: > > html page: > > <html> > <head><title>Title of the page</title> > </head> > > <body> > > <a href="welcome.php?name=Davinder">Pass me</a> > > </body> > </head> > > > > and then php page: > > > <html> > <head><title>Title of the page</title> > </head> > > <body> > <?php > echo "The value passed thru is "; > printf($name); > ?> > > </body> > </head> > > This was taken pretty much right from a tutorial. Doesn't work?! I've > had them pass before in a previous version of an install.. i have since > wiped the drive and reinstalled everything. > > Please help. > > Davinder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#120957) next »