RE: [PHP] Checkboxes

From: Date: Fri, 14 Mar 2003 04:50:26 +0000
Subject: RE: [PHP] Checkboxes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-139665@lists.php.net to get a copy of this message
> I am trying to get results form checkboxes on a form. Each checkbox is > given a value of the id of an item in a table. What I want to do is find > out what is selected and from there get the id so I can create a sql > insert > statement for each selected item. > > I can get the item selected but not a value. > I am using: > > PHP: > > if (count($_POST['skill'])>0) { > for ($i=0;$i<count($_POST['skill']);$i++){ > echo "<li>$fskill[$i]\n"; > } > } > > inside a form > <input type="checkbox" name="skill[]" value="1"> > <input type="checkbox" name="skill[]" value="2"> > <input type="checkbox" name="skill[]" value="3"> > > I get a number of bullets representing the items I check but no value! What is $fskill? Did you forget to update your code? echo "<li>{$_POST['skill'][$i]}</li>\n"; ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#139665) next »