I have a form that works but everything is in one file. I want to separate the thank you page from the rest of the stuff. How would I go about doing that?
is there a redirect snippet or something I can put in there so that when it tries to display the thanks you it would redirect you to the html page i have instead?
form question... please help
Moderator: General Moderators
This was recently answered
viewtopic.php?t=56415
Your modification to it would be something along these lines
viewtopic.php?t=56415
Your modification to it would be something along these lines
Code: Select all
if($validated){
header("location: http://www.yoursite.com/thank_you.html");
}else{
//the code to display to the user because it is not validated
}Let's promote good practice here... make sure no headers have been sent first.
Code: Select all
function redirect($location){
if(!headers_sent()){
header('Location: ' . $location);
}
else{
echo "<a href='" . $location . "'>Continue</a>";
}
exit;
}
if($validated){
redirect("http://www.yoursite.com/thank_you.html");
}else{
//the code to display to the user because it is not validated
}umm... I generally don't like PHP Errors to show up on my web sites... for some strange reason I just feel that it's unprofessional.
That's kind of a strange question... that's like asking... "Why would you check that there is a database connection before attempting to use one... when PHP would report this via an Error?"
As a programmer, it's your responsibility to be paranoid and trust nothing.
That's kind of a strange question... that's like asking... "Why would you check that there is a database connection before attempting to use one... when PHP would report this via an Error?"
As a programmer, it's your responsibility to be paranoid and trust nothing.