How do I call a method when both checkboxes are ticked in php?
if (isset($_POST['check1']))
{data1();}
else if (isset($_POST['check2'])
{data2();}
The above works perfectly for single checkboxes. The moment I tick both it only brings up data1(). I tried the following.
else if(isset($_POST['check1']) && ($_POST['check2']))
{data1and2();}
and
else if(isset($_POST['check1']) && ($_POST['check2']))
{data1and2();}
You missed
issetfor$_POST['check2']And this condition should be first.