Anders_Scales Posted March 24, 2009 Share Posted March 24, 2009 Hello... i am trying to modify this mailform-script to fit my website. What i need to change, is to make the thankyou-site and error-site from being a html-file that's opened, to being a DIV changing style. Here's the script: // ------------- CONFIGURABLE SECTION ------------------------ // $mailto - set to the email address you want the form // sent to, eg //$mailto = "[email protected]" ; $mailto = $_POST['reciever'] ; // $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "Scales Feedback Form" ; // the pages to be displayed, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ; $formurl = "http://www.scalesmusic.dk/feedback.html" ; $errorurl = "http://www.scalesmusic.dk/error.html" ; $thankyouurl = "http://www.scalesmusic.dk/thanks.html" ; $mailto_is_required = 1; $email_is_required = 1; $name_is_required = 1; $uself = 0; $use_envsender = 0; $use_webmaster_email_for_from = 0; $use_utf8 = 1; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ; if (!isset( $use_envsender )) { $use_envsender = 0 ; } $envsender = "-f$email" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (($email_is_required && (empty($email) || !ereg("@", $email))) || ($name_is_required && empty($name)) || ($mailto_is_required && empty($mailto))) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; 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" ; $headers = "From: \"$name\" <$fromemail>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.13.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit ; ?> The site it has to be fit into can be seen on the following url: www.scalesmusic.dk/beta Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/ Share on other sites More sharing options...
Anders_Scales Posted March 25, 2009 Author Share Posted March 25, 2009 Woow theres alot of things happening in this forum! Can anyone help me?!? Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/#findComment-793411 Share on other sites More sharing options...
Yesideez Posted March 25, 2009 Share Posted March 25, 2009 Can you post some output? That codeis too much of a mess first thing in the morning and I've only had one coffee so far Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/#findComment-793415 Share on other sites More sharing options...
Anders_Scales Posted March 25, 2009 Author Share Posted March 25, 2009 Output??? I'm guessing this means a few lines, of the area I asume has to be moddified, so heres the part: if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (($email_is_required && (empty($email) || !ereg("@", $email))) || ($name_is_required && empty($name)) || ($mailto_is_required && empty($mailto))) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; As far as i can see, this is the part that decide the different actions for pressing the Post-button. Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/#findComment-793479 Share on other sites More sharing options...
Anders_Scales Posted March 25, 2009 Author Share Posted March 25, 2009 Do you need the html-part too? The Inputs? Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/#findComment-793946 Share on other sites More sharing options...
Anders_Scales Posted March 26, 2009 Author Share Posted March 26, 2009 It takes some serious bumping to be seen in this forum! Can anybody help me? Else I'll try to find a forum where your post isn't moved down an entire site overnight :-\ Link to comment https://forums.phpfreaks.com/topic/150855-need-help-with-mailform-script/#findComment-794251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.