Re: $HTTP_POST_VARS

From: Date: Tue, 13 Mar 2001 15:56:33 +0000
Subject: Re: $HTTP_POST_VARS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43672@lists.php.net to get a copy of this message
I am having a similar problem as the original poster. In my case, I _want_ the second sumbission to overwrite the first, but it's not happening. What I have is a radio button list all named="update" each with it's own value (ie. 2,3,4,5,etc.). The form is self-submitting and tests on 'update' to know how to proceed. What I'm experiencing is that after the first submission, printing out '$HTTP_POST_VARS' array gives the correct update value. Subsequent submissions also show this same value no matter what value is selected in the form. I've tried using 'unset($HTTP_POST_VARS[update]);' at the end of the script after the var has been used and reprintingg the HTTP_POST_VARS array which shows that it was unset, but on resubmission of the form, it reappears! losing hair, David Minor on 3/8/01 5:45 PM, php-general-digest-help@lists.php.net at php-general-digest-help@lists.php.net wrote: > Explained here: > http://www.php.net/manual/en/language.variables.external.php > > Basically name the variables with []. For example: > > <input type=text name="Name[]"> > > In your example, the second is actually overwriting the first. > > > Nate > > -----Original Message----- > From: mat t [mailto:mat@remail.net] > Sent: Thursday, March 08, 2001 3:10 PM > To: php-general@lists.php.net > Subject: [PHP] $HTTP_POST_VARS > > > Please can you help: > > I can't send duplicate input types to $HTTP_POST_VARS > For example: > ---------------HTML------------------- > First person: > > NAME <input type="text" name="Name" size="24" > value=""> > <input name="Name_type" type="hidden" value="textbox"> > > Phone No.<input type="text" name="Phone" size="24" > value=""> > <input name="Phone_type" type="hidden" value="textbox"> > > Second Person: > > NAME <input type="text" name="Name" size="24" > value=""> > <input name="Name_type" type="hidden" value="textbox"> > > Phone No.<input type="text" name="Phone" size="24" > value=""> > <input name="Phone_type" type="hidden" value="textbox"> > > ------------------------------------------------------- > > Then when I use : > > reset ($HTTP_POST_VARS); > while (list ($key, $val) = each ($HTTP_POST_VARS)) > { > echo "$key => $val<br>\n"; > } > > Here is the output > > ----------------Output-------------------------- > > Name => > Name_type => textbox > Phone => > Phone_type => textbox > > ------------------------------------------------ > > What happened to the Second person? > How can I stop it ignoring duplicates and insert in the array 1 by 1? >

« previous php.general (#43672) next »