I want to be able to take a different action with one submit button depending on circumstances. So I'm trying to use the following statement.
If ($ErrFlag) {
echo "<BR>this should be customer";
echo "<form NAME=\"errform\" ACTION=\"customer.php\">";
}
else {
echo "<BR>this should be checkout";
echo "<form NAME=\"goodform\" ACTION=\"checkout.php\">";
}
My problem is this. If there is no error, it definitely gets to the else because it echo the "this should be checkout" statement. It doesn't go to checkout.php. It stays in Customer. However, if I click submit again without changing anything, it goes to checkout.
I had a Switch program I was using but it did the same thing. It wouldn't work the first time I hit submit, but it hit the second time.
What am I doing wrong?
Thanks in advance.
If ($ErrFlag) {
echo "<BR>this should be customer";
echo "<form NAME=\"errform\" ACTION=\"customer.php\">";
}
else {
echo "<BR>this should be checkout";
echo "<form NAME=\"goodform\" ACTION=\"checkout.php\">";
}
My problem is this. If there is no error, it definitely gets to the else because it echo the "this should be checkout" statement. It doesn't go to checkout.php. It stays in Customer. However, if I click submit again without changing anything, it goes to checkout.
I had a Switch program I was using but it did the same thing. It wouldn't work the first time I hit submit, but it hit the second time.
What am I doing wrong?
Thanks in advance.