bav1 Posted February 28, 2007 Share Posted February 28, 2007 hi all im trying to configure a scrpit to post the contents of a form to email but keep getting an error im sure its somthing simple but its got me heres the script */ // ------------- CONFIGURABLE SECTION ------------------------ // $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ; $mailto = 'support@icarus3w.com' ; // $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "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.sjmonlineretail.co.uk/forms" ; $errorurl = "http://www.sjmonlineretail.co.uk/error.htm" ; $thankyouurl = "http://www.sjmonlineretail.co.uk/thankyou.htm" ; // -------------------- END OF CONFIGURABLE SECTION --------------- $name = $_POST['name']'; $email = $_POST['email']'; $comments = $_POST['comments']'; $please quote me = $_POST['please quote me']'; $Model = $_POST['Model']'; $Memory = $_POST['Memory']'; $Rom = $_POST['Rom']'; $HDD = $_POST['HDD']'; $Misc = $_POST['Misc']'; $Software = $_POST['Software']'; $Other requirements = $_POST['Other requirements']'; $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 (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.03" ); header( "Location: $thankyouurl" ); exit ; ?> and heres the link to the contact page the the form resides any help would be much appriciated http://www.sjmonlineretail.co.uk/contact.htm thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/ Share on other sites More sharing options...
Orio Posted February 28, 2007 Share Posted February 28, 2007 What error are you getting? Orio. Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196116 Share on other sites More sharing options...
bav1 Posted February 28, 2007 Author Share Posted February 28, 2007 hi orio im getting the error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/sjmonl11/public_html/feedback.php on line 68 Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196117 Share on other sites More sharing options...
itsmeArry Posted February 28, 2007 Share Posted February 28, 2007 Here is the error :: $name = $_POST['name']'; $email = $_POST['email']'; $comments = $_POST['comments']'; $please quote me = $_POST['please quote me']'; $Model = $_POST['Model']'; $Memory = $_POST['Memory']'; $Rom = $_POST['Rom']'; $HDD = $_POST['HDD']'; $Misc = $_POST['Misc']'; $Software = $_POST['Software']'; $Other requirements = $_POST['Other requirements']'; use this $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; $please quote me = $_POST['please quote me']; $Model = $_POST['Model']; $Memory = $_POST['Memory']'; $Rom = $_POST['Rom']; $HDD = $_POST['HDD']; $Misc = $_POST['Misc']; $Software = $_POST['Software']; $Other requirements = $_POST['Other requirements']; Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196119 Share on other sites More sharing options...
bav1 Posted February 28, 2007 Author Share Posted February 28, 2007 if needed the source for this form is here http://www.sjmonlineretail.co.uk/contactform.htm thanks in advance jon Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196120 Share on other sites More sharing options...
bav1 Posted February 28, 2007 Author Share Posted February 28, 2007 thanks mate but now getting Parse error: syntax error, unexpected T_STRING in /home/sjmonl11/public_html/feedback.php on line 70 cheers jon Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196121 Share on other sites More sharing options...
itsmeArry Posted February 28, 2007 Share Posted February 28, 2007 wht is on line 70 of feedback.php Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196124 Share on other sites More sharing options...
Orio Posted February 28, 2007 Share Posted February 28, 2007 See this line? $Memory = $_POST['Memory']'; It should be: $Memory = $_POST['Memory']; Orio. Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196126 Share on other sites More sharing options...
bav1 Posted February 28, 2007 Author Share Posted February 28, 2007 hi orio sorry to be a pain mate i have changed that as suggested $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; $please quote me = $_POST['please quote me']; $Model = $_POST['Model']; $Memory = $_POST['Memory']; $Rom = $_POST['Rom']; $HDD = $_POST['HDD']; $Misc = $_POST['Misc']; $Software = $_POST['Software']; $Other requirements = $_POST['Other requirements']; $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 (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.03" ); header( "Location: $thankyouurl" ); exit ; ?> but still get error Parse error: syntax error, unexpected T_STRING in /home/sjmonl11/public_html/feedback.php on line 70 Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196175 Share on other sites More sharing options...
Orio Posted February 28, 2007 Share Posted February 28, 2007 You can't have a space in variable names. Change these lines: $Other requirements = $_POST['Other requirements']; $please quote me = $_POST['please quote me']; Into: $Other_requirements = $_POST['Other requirements']; $please_quote_me = $_POST['please quote me']; Orio. Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196179 Share on other sites More sharing options...
bav1 Posted February 28, 2007 Author Share Posted February 28, 2007 thanks mate thats sorted the error but the mail i receive is as below and does not show all the info entered into the form This message was sent from: http://www.sjmonlineretail.co.uk/contactform.htm ------------------------- COMMENTS ------------------------- Comments :test comments ------------------------------------------------------------ i suspect this is somthing to do with the bottom part of the script $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.03" ); header( "Location: $thankyouurl" ); exit ; ?> will this script do what i need or do i need to write one from scratch here is the form that i want the resilt posted from http://www.sjmonlineretail.co.uk/contactform.htm sorry to be awkward thanks for all your help Quote Link to comment https://forums.phpfreaks.com/topic/40529-please-help/#findComment-196184 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.