In further thought on this, I'm not sure that $_POST['skill'] is an array.
Hugh
----- Original Message -----
From: "Stephen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 8:47 PM
Subject: [PHP] Checkboxes
> Hi
>
> 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!
>
> Thanks,
>
> Stephen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php