Your Ad Here

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

  • 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


    People are coming into this page using keywords :  php handle multiple inputs,  reading checkbox from php,  in javascript how to handle multiple checkbox,  how to apply ajax on multiple checkbox,  email multiple checkboxes php
    This keyword are get by search engine terms.
    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Digg
    • del.icio.us
    • Facebook
    • Google
    • StumbleUpon
    • Furl


    Leave a Reply

    Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.

    *
    To prove that you're not a bot, enter this code
    Anti-Spam Image