multiple checkbox .. how to get value 1 by 1

Discussion in 'PHP' started by exoskeleton, Jun 25, 2012.

  1. #1
    hi guys.. need help about check box..

    i have 10 records showing in a table and want to delete more than 1 record...
    each rows have checkbox to be checked if you want to delete this record.
    if i checked more than 1 record of course the url will look like this

    " http://localhost:82/delete.php?emp_id=5&emp_id=12&Submit=Delete "

    how can i get the value of emp_id where they have the same name (emp_id)?

    $emp_id = $_GET['emp_id'] will only get 1 value.. that is my problem... how to get all the value from the checkbox
     
    exoskeleton, Jun 25, 2012 IP
  2. shubhamm

    shubhamm Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Send the values in Array by using Javascript Of Jquery of selected Checkbox & Then use
    $emp_id = $_GET['emp_id']
    explode(",",$emp_id);
    then for loop

    " delete.php?emp_id=5,2,3,4,5,5&Submit=Delete "
     
    shubhamm, Jun 25, 2012 IP