Failed redirect after mailing data from a form - stuck on script page,
displaying zero
I succcessfully created a form to email a request for a quote for my
company. It works -- the data collects and is validated and the email
sends. That page is at:
http://www.bardonsoliver.com/newbnocm/request_quote.shtml
However, I wanted a redirect to a thank-you page, at:
http://www.bardonsoliver.com/newbnocm/thank_you.shtml
At first, when I ran the form, it redirected fine. Now I just get left on
the script page with a zero displayed in the upper left-hand corner.
I had to change from "header" to "location" due to error messages.
This is the end of the script, directly after the code that creates and
sends the e-mail:
if( $mailsend = TRUE) {
unset($_GET['do']);
printf("<script type='text/JavaScript'>location='" + $typage
+"'</script>");
exit;
} else {
unset($_GET['do']);
printf("<script type='text/JavaScript'>location='" + $retpage
+"'</script>");
printf("<script type='text/JavaScript'>window.alert('We are unable to
send your e-mail at this time. Please contact Ben through the contact
page or try again later. Thank you.')</script>");
exit;
}
$typage is set previously, to:
$typage='../thank_you.shtml';
and $retpage is:
$retpage='../request_quote.shtml';
The paths are correct -- the scripts are a 'level down' from the main
directory where all the pages are.
I'm a relative beginner with PHP and I am sure someone more expert than I
will look at this and see the problem immediately. Thanks.
No comments:
Post a Comment