php - Multiple checkbox validation before sql insert -


i have problem similar post:

how check multiple $_post variable existence using isset()?

my issue is, have rather large list of checkboxes need know if checked in order set status of $row. mentioned script,all and's, except have , or thrown in works.

if (  isset($_post['facial1'])      && ($_post['facial2'])      && ($_post['facial3'])     && ($_post['facial4'])      && ($_post['intra-oral1'])      && ($_post['intra-oral2'])     && ($_post['intra-oral3'])      && ($_post['intra-oral4'])      && ($_post['intra-oral5'])      && ($_post['intra-oral6'])      && (          (              ($_post['x-ray1'])            && ($_post['x-ray3'])          )          || ($_post['x-ray5'])        )    ) {     $status = 1;  } else {     $status = 0; } 

each time run test, gets element not checked throws error: undefined index: xxx. xxx first none checked item.

checkboxes not checked not sent part of post body. code needs use isset:

if (  isset($_post['facial1'])  && isset($_post['facial2'])  && isset($_post['facial3']) && isset($_post['facial4'])  && isset($_post['intra-oral1'])  && isset($_post['intra-oral2']) && isset($_post['intra-oral3'])  && isset($_post['intra-oral4'])  && isset($_post['intra-oral5'])  && isset($_post['intra-oral6'])  && (      (          isset($_post['x-ray1'])            && isset($_post['x-ray3'])          )          || isset($_post['x-ray5'])        )    ) {     $status = 1;  } else {     $status = 0; } 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -