handling checked checkboxes PHP

前端 未结 3 1998
一个人的身影
一个人的身影 2021-01-25 01:47

I have a table that takes data from the database like so: (Is not a form)

if (mysql_num_rows($result)) {
        echo \"
3条回答
  •  忘了有多久
    2021-01-25 02:12

    foreach($_REQUEST['mark'] as $value){
        echo "$value was selected\n 
    "; }

    if you want to know which one wasn't selected then store all possible selections into an array and walk ofer this array and do someting like

    foreach($poss_select as $key=>$val){
        if(!in_array($val,$_REQUEST['mark']){
            $not_selected[$key] = $value;
        }else{
            deleteRow($value);
        }
    } 
    

提交回复
热议问题