Re: Many variables. I want one array. How?

From: Date: Tue, 28 Nov 2000 16:24:33 +0000
Subject: Re: Many variables. I want one array. How?
Groups: php.general 
Request: Send a blank email to php-general+get-27612@lists.php.net to get a copy of this message
Well, based on the fact that a <select multiple> will pass its values back as a comma-delimited string, and that if you do <select name="myarray[]" multiple> your values will be fed into an array, I would try the following: <checkbox name="myarray[]"> label1 <br> <checkbox name="myarray[]"> label2 <br> <checkbox name="myarray[]"> label3 <br> <checkbox name="myarray[]"> label4 <br> <checkbox name="myarray[]"> label5 <br> I haven't tested this yet, but it should work... Pascal ----- Original Message ----- From: "Marko Perich" <mperich@araucaniasur.cl> To: <php-general@lists.php.net> Sent: Tuesday, November 28, 2000 12:17 PM Subject: [PHP] Many variables. I want one array. How? > Hello. > > My problem is that i am creating a form from a .php page and that page can > have from 1 to many rows. In each row there is a checkbox named "cbX", where > X is the number of the row. > > I want the .php called from the previous submit to have access to the cbX > variables in an array (so i can work with it into a for loop). > > JavaScript does it automagically if I give the checkbox the same name (say > just "cb"), but in php I don't know how. > > Any suggestion, clues, alternatives are gracefully accepted. > > Thanks. > > Marko. > > > -- > 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 > >

« previous php.general (#27612) next »