I have several submit inputs (buttons) on a page, with the following isset
conditions:
if ( isset( $_POST[ 'noranTelChecks' ] ) ) { // user requested noranTelCheck sheet
header( 'location: noranTelChecks.php' );
} elseif ( isset( $_POST[ 'juniperChecks' ] ) ) { // user requested noranTelCheck sheet
header( 'location: juniperChecks.php' );
} elseif ( isset( $_POST[ 'mpr95001Checks' ] ) ) { // user requested noranTelCheck sheet
header( 'location: mpr95001Checks.php' );
} // close IF
But no matter what button is clicked the page is always redirected to the link referred to by the first IF
condition. If I change the order of the links referred to, it is always the link in the first condition that the page gets redirected to.
What could be the problem with the above code causing this issue, as I have done this in the past on other pages and it has worked fine?
$_POST
in all cases – Ear$location
) within your if/elseif, then just make one single call toheader('location: ' . $location);
outside of it - maybe that helps somehow? – Conceiveexit();
after the calls toheader()
. – Conceivevalue=1
and so I guess theisset
condition was always being met no matter what button is clicked. – InconsequentialnoranTelChecks
is never empty, please check your html form, I think there is a mistake – Haematoma