RE: [PHP] $HTTP_POST_VARS
| From: | Nathaniel Hekman | Date: | Thu, 08 Mar 2001 22:13:58 +0000 |
| Subject: | RE: [PHP] $HTTP_POST_VARS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-43079@lists.php.net to get a copy of this message | ||
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?
_____________________________________________________________
Pick up your email anywhere in the world ---> http://www.remail.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net