...

View Full Version : Send to thankyou page after form submit



pdpascual
07-26-2011, 07:14 PM
I have this at the bottom of the page and there i would like to redirect to thankyou page tried using header('thankyou.html....

<?php
} else {
error_reporting(0);

if (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))

//Message sent!
//It the message that will be displayed when the user click the sumbit button
//You can modify the text if you want
echo nl2br("
<div class=\"MsgSent\">
<h1>Congratulations!!</h1>
<p>Thank you <b><?=$name;?></b>, your message is sent!<br /> I will get back to you as soon as possible.</p>
</div>
");

else

// Display error message if the message failed to send
echo "
<div class=\"MsgError\">
<h1>Error!!</h1>
<p>Sorry <b><?=$name;?></b>, your message failed to send. Try later!</p>
</div>";
}
?>

djh101
07-26-2011, 07:17 PM
So... what exactly is the problem? Also, it would make things a lot easier to read if you could surround your php in php tags.

tangoforce
07-26-2011, 07:27 PM
I have this at the bottom of the page and there i would like to redirect to thankyou page tried using header('thankyou.html....

That won't work. You can't output a header after starting your output. You can only use the header() function BEFORE any output to the browser.

I have a link in my signature about this (headers already sent), please read it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum