runnerjp Posted June 17, 2006 Share Posted June 17, 2006 hey all.... ok here it is... i have put a php file in to my website as a contact formwww.werun2win.com/contact.htmlwhen you hit the send button its sends you to a page www.werun2win.com/feedback.php [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] i want it to go to www.werun2win.com/thanks.htmlhere is script*/// ------------- CONFIGURABLE SECTION ------------------------// $mailto - set to the email address you want the form// sent to, eg//$mailto = "[email protected]" ;$mailto = '[email protected]' ;// $subject - set to the Subject line of the email, eg//$subject = "Feedback Form" ;$subject = "werun2win.com" ;// the pages to be displayed, eg//$formurl = "" ;//$errorurl = "" ;//$thankyouurl = "" ;$formurl = "http://www.werun2win.com/contact.html" ;$errorurl = "http://www.werun2win.com/error.html" ;$thankyouurl = "http://www.werun2win.com/thanks.html" ;$uself = 0;// -------------------- END OF CONFIGURABLE SECTION ---------------$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;$name = $_POST['name'] ;$email = $_POST['email'] ;$comments = $_POST['comments'] ;$http_referrer = getenv( "HTTP_REFERER" );if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ;}if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ;}if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ;}if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments );}$messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ;mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );header( "Location: $thankyouurl" );exit ;?> Quote Link to comment https://forums.phpfreaks.com/topic/12230-contact-script-gone-wrong/ 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.