Re: Checkboxes
| From: | Hugh Danaher | Date: | Fri, 14 Mar 2003 09:09:49 +0000 |
| Subject: | Re: Checkboxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139685@lists.php.net to get a copy of this message | ||
In further thought on this, I'm not sure that $_POST['skill'] is an array.
Hugh
----- Original Message -----
From: "Stephen" <sbarrow@pittsh.com.au>
To: <php-general@lists.php.net>
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
>