Handle Multiple CheckBox in PHP
Some time when you program in PHP you need to check what checkbox have been checked.
When i used to want to handle this …
I find it’s very difficult …
After do some research … finally i found this easy method …
Here the source code …
//index.php
<HTML>
<FORM ACTION="cekCB.php" METHOD="POST">
<INPUT TYPE="CHECKBOX" NAME="CB[]" VALUE="1">1<BR>
<INPUT TYPE="CHECKBOX" NAME="CB[]" VALUE="2">2<BR>
<INPUT TYPE="CHECKBOX" NAME="CB[]" VALUE="3">3<BR>
<INPUT TYPE="CHECKBOX" NAME="CB[]" VALUE="4">4<BR>
<INPUT TYPE="CHECKBOX" NAME="CB[]" VALUE="5">5<BR>
<INPUT TYPE="SUBMIT" VALUE="SEND">
</FORM>
</HTML>
<?
//cekCB
$CB = $_POST["CB"];
for ($i=0;$i<count($CB);$i++)
{
echo "CB Checked Value = " . $CB[$i] . "<BR>";
}
?>
Post Info
This entry was posted on Wednesday, May 23rd, 2007 and is filed under PHP.You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: Free Walpaper Changer and Calendar »
Next Post: AJAX Foundation »
Latest Posts
- Viewing Friendster Hidden Comments (38)
- Merge FLV with Avidemux (11)
- FLV Player for Nokia Series 60 3rd Edition (9)
- How To View Hidden Files (9)
- Investing Stock (5)
- Yahoo Messenger For Nokia 9300i (5)
- Detect Invisible User In Yahoo Messenger (5)
- Games For Nokia N73 (5)
- Convert FLV To 3gp (4)
- How To Open docx Files ? (4)
Read More
Related Reading:Previous Post: Free Walpaper Changer and Calendar »
Next Post: AJAX Foundation »
This some posting which are related to this article : just read related article







