Jump to content

form to email problems


bav1

Recommended Posts

Hi all i am currently trying to get the contents of a form to be sent to an email address but not have much luck

 

http://www.sjmonlineretail.co.uk/contactform.htm

 

i am currently using a feedback php as below

 

 

// ------------- CONFIGURABLE SECTION ------------------------

 

// $mailto - set to the email address you want the form

// sent to, eg

//$mailto = "[email protected]" ;

 

$mailto = 'support@******.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 ;

 

?>

 

thanks to orio for all his help but i only receive the comments not all of the other info can anyone help

 

thanks in advance

 

jon

Link to comment
https://forums.phpfreaks.com/topic/40546-form-to-email-problems/
Share on other sites

Next time go to the freelancing forum...

 

<?php

// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto      = "[email protected]" ;

$mailto = 'support@******.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 );
}

$message = "This message was sent from:\n".$http_referrer."\n\n";
$message .= "comments\n-----\n".$comments ."\n----\n\n";
$message .= "Please-Quote-Me\n----\n".$please_quote_me."\n-----\n\n";
$message .= "Model: ".$model."\n";
$message .= "Memmory: ".$memmory."\n";
$message .= "Rom: ".$rom."\n";
$message .= "HDD: ".$hdd."\n";
$message .= "Misc: ".$misc."\n";
$message .= "Software: ".$software."\n";
$message .= "Other Reqs: ".$other_requirements."\n";

mail($mailto, $subject, $message, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.03" );
header( "Location: $thankyouurl" );
exit ;

?>

 

 

Orio.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.