EASY PHP: How do you get checkboxes/tickboxes to send from a contact page?

  • Thread starter Thread starter John M
  • Start date Start date
J

John M

Guest
Many thanks in advance!

I have a working contact form on my new website, and I have an HTML talking to a PHP mail script. All the text boxes are communicating fine with script, it's just a couple checkboxes that aren't showing up in the form that is sent to my email.

http://www.alpha-duplication.com/howies/pages/info/quote.html
( Line 175 in the HTML code)

Line 28 and 68 in the PHP script:
<?php

$mailto = '[email protected]';
$subject = "Quote Request Form" ;

$formurl = "http://www.alpha-duplication.com/howies/pages/info/quote.html" ;
$errorurl = "http://www.alpha-duplication.com/" ;
$thankyouurl = "http://www.alpha-duplication.com/howies/" ;

$email_is_required = 1;
$name_is_required = 1;
$uself = 0;
$use_envsender = 1;
$use_webmaster_email_for_from = 1;
$use_utf8 = 1;

$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$mailto" ;
$name = $_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$address = $_POST['address'];
$postcode = $_POST['postcode'];
$phone = $_POST['phone'];
$details = $_POST['details'];
$addToList = $_POST['addToList'];
$noEmailList = $_POST['noEmailList'];
$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))) {
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" .
"Company: $company\n" .
"Address: $address\n" .
"Postcode: $postcode\n" .
"Phone Number: $phone\n" .
"Project Details: $comments\n" .
"Add to Email List? $addToList\n" .
"Don't add to Email List: $noEmailList\n" .
"\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" );

?>
 
Back
Top