jen56456 Posted December 12, 2007 Share Posted December 12, 2007 Hi I have this feed back form in PHP. It works but doesn't let you specify a custom thank you page after you hit send... What code needs to be in there to do that??? <?php $name=addslashes($_POST['name']); $email=addslashes($_POST['email']); $comments=addslashes($_POST['comments']); // you can specify which email you want your contact form to be emailed to here $toemail = "EMAILHERE@DOMAIN.COM"; $subject = "contact form submission"; $headers = "MIME-Version: 1.0\n" ."From: \"".$name."\" <".$email.">\n" ."Content-type: text/html; charset=iso-8859-1\n"; $body = "Name: ".$name."<br>\n" ."Email: ".$email."<br>\n" ."Comments:<br>\n" .$comments; if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email)) { echo "That is not a valid email address. Please return to the" ." previous page and try again."; exit; } mail($toemail, $subject, $body, $headers); echo "Thank you for your submission."; ?> Quote Link to comment Share on other sites More sharing options...
emehrkay Posted December 12, 2007 Share Posted December 12, 2007 just add it to the end of your code Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 echo "Thank you for your submission."; ?> insert a HTML or a Java Redirect here. Quote Link to comment Share on other sites More sharing options...
jen56456 Posted December 12, 2007 Author Share Posted December 12, 2007 how? Quote Link to comment Share on other sites More sharing options...
jen56456 Posted December 12, 2007 Author Share Posted December 12, 2007 you mean just put a regular html redirect there? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 Yes Quote Link to comment Share on other sites More sharing options...
jen56456 Posted December 12, 2007 Author Share Posted December 12, 2007 isn't there a classier way of doing it in php? Quote Link to comment Share on other sites More sharing options...
emehrkay Posted December 12, 2007 Share Posted December 12, 2007 no redirect needed, well if you want a redirect you can use one, but all you have to do is code the thank you at the end of your script Quote Link to comment Share on other sites More sharing options...
jen56456 Posted December 12, 2007 Author Share Posted December 12, 2007 so just put the thank you page code at the bottom? let me try that Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 What does classier mean? It's only one line of code. isn't there a classier way of doing it in php? Quote Link to comment Share on other sites More sharing options...
jen56456 Posted December 12, 2007 Author Share Posted December 12, 2007 ok it works thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.