Re: Parameter passing
| From: | EaTrom | Date: | Fri, 29 Dec 2000 21:53:17 +0000 |
| Subject: | Re: Parameter passing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32218@lists.php.net to get a copy of this message | ||
There is an HTML form with a batch of checkboxes. The FORM ACTION points to
my php3 script, passing in the values of the checkboxes
(myscript.php3?listname1="a"&listname2="b"&listname3=""&listname4=""&
si1=""&si2="jerry"&si3="no"&si4=""&si5="")
The following is where I decode the vars being passed in. Currently, I am
just concating the vars together and then later I walk through them using
split(",",$testlist).
Because this may be changing (ie, adding more vars), I'd rather use
(list($k,$v)=each($argv)) to put them into an array. But I don't seem to get
the $argv the way I expect it.
snippet:
$testlist = "$listname1,$listname2,$listname3,$listname4";
$testlist .= ",$si1,$si2,$si3,$si4,$si5,$si6,$si7,$si8";
> From: Rasmus Lerdorf <rasmus@php.net>
> Date: Thu, 28 Dec 2000 10:32:38 -0800 (PST)
> To: EaTrom <eatrom@i29.net>
> Cc: <php-general@lists.php.net>
> Subject: Re: [PHP] Parameter passing
>
> What do you mean by a long series of vars coming in from calling a file?
> How are you calling this file, and how are you getting the variables?
>
> On Thu, 28 Dec 2000, EaTrom wrote:
>
>> I've a quick question, since it appears to be "no such thing" but wanted to
>> see if maybe I just missed it somewhere.
>>
>> In Perl, you can get the passed parameters in $_ ; is there such a thing in
>> PHP?
>>
>> The reason I ask, is that I have a long series of vars coming in from a
>> calling file, and I want to just use list($k,$v)=each($_) to walk through
>> them.
>>
>> Terry
>>