Topic: Need help to get data from multiple checkboxes with the same name

As mentioned in the subject I want to get data via POST method.  I have multiple checkboxes, which have the same name but different values. The user should be able to select more than one checkbox (so I don't speak of radio buttons).
As register_global (or something like that) seems to be unavailable in punbb due to security reasons, I'd like to know how I can get these data?

Thx a lot

Martin

Re: Need help to get data from multiple checkboxes with the same name

Give them different names.

3 (edited by Ruckus 2006-01-24 18:38)

Re: Need help to get data from multiple checkboxes with the same name

you ahve to give them an id like,

<input type="checkbox" name="checkBoxGroupName[IDNUMBER] />

And then something along the lines of:

(taken from admin_reports.php in punbb)

if (isset($_POST['zap_id']))
{
        confirm_referrer('admin_reports.php');

        $zap_id = intval(key($_POST['zap_id']));

the key gets the number inside of the [] not sure how to exactly do it from more than one name at a time, tho you could get an idea of how to do it from admin_options.php as that uses the same idea i think.

Im at school atm and i just SSHed to my home computer to open up admin_reports.php to get that code, rest is from memory, but it should give you an idea of where to look.