I want to redirect the page on the if condition.
this is my html page
and this is my payment_mode.php page
$i= $_POST['selectmode'];
if($i>1)
{
header("Location : detail.php");
}
else
{
header("Location : home.php");
}
?>
bt it does not redirect the page detail.php and home.php
Answer
Try:
$i= $_POST['selectmode'];
if($i>1)
{
header("Location: detail.php");
exit;
}
else
{
header("Location : home.php");
exit;
}
Also, make sure on this page there is nothing being outputted before your calling the header()
function.
No comments:
Post a Comment