I have a problem with "condition in condition". Both conditions are dependent on submit button in form. Situation: user clicks on first submit button -> the 3 methods of Class are called -> third method "creates" another form with another submit button. This submit button is subject of the second important condition. When the second submit button is pressed, there are 2 method to be call. But nothing happend. The fourth Method and fifth Method should be follows on the previous methods. How I can solve this? I hope that the problem description is not confusing. There is a little code example too. Thanks.
$c = new Class;
if(isset($_POST['button'])) {
$c->firstMethod();
$c->secondMethod();
if($c->thirdMethod() != false) {
echo ".. the second form with submit button will be here ...";
}
if(isset($_POST['button_of_second_form'])) {
$c->fourthMethod();
$c->fifthMethod();
}
}
I believe when the second form is submitted it will not pass from the first condition because first you are checking:
if(isset($_POST['button'])) {....
and inside this condition block you are checking the 2nd form. If you can include the hidden value of button
in the 2nd form then it will get pass from the first condition but then you have to take care of the first & second method to not run.