Re: Problems with HTTP_POST_VARS
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 24 Nov 2000 20:24:11 +0000 |
| Subject: | Re: Problems with HTTP_POST_VARS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27013@lists.php.net to get a copy of this message | ||
On Fri, 24 Nov 2000, Rafael Steil wrote:
> Hi.
> For example:
> my form have 3 fields:
>
> <inpu type=checkbox name=data value=one>
> <inpu type=checkbox name=data value=two>
> <inpu type=checkbox name=data value=four>
>
> well, when user click on Submit button, I only can get the value of the last chekbox
> checked./... and the others values, how I can retrieve it???
>
> I use the following code:
>
> foreach($HTTP_POST_VARS as $data)
> echo "$data<br>";
>
> ( ok, ok.. is bad, but is a example.. :)
>
> In Perl, its possible to use the read() function
>
> read(STDIN, $buffer, $ENV{"CONTENT_LENGTH"})
>
> buth I've some problens to implement it with PHP ( fopen("php://stdin") crash )
>
> Can someone help-me????
>
> Rafael Steil
>
Try:
<input type=checkbox name=data1 value=one>
<input type=checkbox name=data2 value=two>
<input type=checkbox name=data3 value=four>
And:
for ($i=1; $i<=3; ++$i)
{
if (isset(${"data".$i}))
print ${"data".$i};
};
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>