I am trying to create a web site where the intention is that when the registration is successful redirect to finish.php else be on the same page i.e. register.php the code is as below:
try {
$mail->send();
$msg = "An email has been sent for verfication.";
echo "<script type='text/javascript'>alert('$msg');</script>";
redirect("finish.php");
$msgType = "success";
}
in the above code the function of inserting in db is completed. alert message is shown on the page but the page is not redirected to finish.php my form submit looks like:
<form action="free_register.php" class="form-horizontal well" method="post" name="f" onsubmit="return validateForm();">