Re: Forms...

From: Date: Fri, 16 May 2003 15:13:07 +0000
Subject: Re: Forms...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147904@lists.php.net to get a copy of this message
> Is there any easy way to develop an array of the form values that were > posted to a php script... > > as in. say we had a person fill out their $name, $email, and $phone in > this order. Can > we make a script that picks up every variable in the order that it was > posted from the form such that $formvariables[0] would yield Russ Jones, > or $formvariable[1] would yield rjones@email.unc.edu ??? I need to figure > out how to do this regardless of the name and number of variables, such > that I could have numerous different forms with different values and > different variables all point to the same php script used to process that > form. Hmmm... maybe you could just put them into a $_POST or $_GET array.. that would be useful. :) oh wait... $_GET or $_POST or $_REQUEST already are arrays that contain the data from your form (depending upon your method). The "key" of the array is the name of you input element. echo $_POST['inputbox']; for a text box named "inputbox". Even on older versions of PHP you have the $HTTP_POST_VARS and $HTTP_GET_VARS arrays. ---John Holmes...

« previous php.general (#147904) next »