Hi everyone,
I have a simple query for you all.
I have made a form which uses php to email the information to a user. I was just wondering how i would go about linking to a success page after the form has been submitted.
My email.php code ends like this below. I am currently using an echo command in the mean time.
I'm not sure where the command would go to call the success.html or php page either. In my form.php or the email.php?
mail($sendTo, $subject, $headers);
echo "Thankyou"
?>
Any assistance would be greatly appreciated.
Thanks,
David
help with linking to a success page after form is submitted
Moderator: General Moderators
Look at using header() to redirect the user to the page you want, e.g.
Please keep in mind that when using header(), you can't display any output to the user in that script unless you want to use output buffering.
Code: Select all
if ( mail($sendTo, $subject, $headers) != FALSE ) {
header("Location: success.php");
}