Re: [PHP] How to pass unknown number of variables to a function?

2002-07-05 Thread Uwe Birkenhain
Thank's for the help everybody! I used something different (a little like this nice one from Terence (thank you!) but with JS: I named my form 'test' and included a hidden field 'collector'. At the checkboxes the name is the value I need. The box, when checked, gets the value 1. In the boxtags

Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Jason Wong
On Thursday 04 July 2002 16:52, Uwe Birkenhain wrote: Hi everybody on this rainy morning! My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't

Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Alberto Serra
Uwe Birkenhain wrote: Hi everybody on this rainy morning! Rainy!? It's damn hot in Kiev :) My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't

RE: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Rudolf Visagie
Hi Uwe, If you define the checkbox list as an array (OptionList[] in the example below), only the checked values will be returned as an array $OptionList when you post the form. You can then use this as an array or pass it as an array to a function in the script: ? $i = 0; while

Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Terence Kearns
This is a nice easy one :) It couldn't be simpler. Just put empty square brackets (as used in arrays) in front of your checkbox name. The example below assumes you have PHP 4.1 or greater (which uses $_POST to contain form posted data) notice how name=ck[] html head