I am using javascript confirm withing PHP if statement. I want if I click OK, execution should get out of the current if and move to execute the next code, which is an else if. It is not working. is there a way to do it?
if(.....){....}
else if(!isset($_POST['cpage']) || empty($_POST['cpage'])){
    echo '<script> 
    
    if(confirm("Do you want to proceed?")){
       break;//*both break and continue do not work!*
    }
    else{
    
         history.go(-1);
    }
   
    
    </script>';
}
    
else if(//*from break, evaluate this*){
//execute
}