Im having a problem getting my checkbox info to send and was wondering if anyone has any ideas. I have attempted to crack the code but my php is limited. Any help would be greatly appreciated.
CODE
<?php
$to = $_REQUEST['me@emailaddress.com'];
$from = $_REQUEST['email'];
$name = $_REQUEST['name'];
$headers = "From: $from";
$subject = "Contact Form Information Request";
ini_set('sendmail_from', $from);
$fields = array();
$fields{"name"} = "Name";
$fields{"address"} = "Address";
$fields{"tel"} = "Telephone Number";
$fields{"email"} = "Email Address";
$fields{"boat"} = "Do you own your own boat";
$fields{"time"} = "How long have you owned this boat ";
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a])\n $check_msg; }
$headers2 = "From: $to";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us.
Somebody will get back to you as soon as possible, usually within 48 hours. If you have any more questions, please consult our website at www.bridge-marine.co.uk or alternatively you can call us on Tel Number";
if($from == '') {header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/error.html" );}
else {
if($name == '') {header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/error.html" );}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/thankyou.html" );}
else
{print "We encountered an error sending your mail, please notify me@emailaddress.com";}
}
}
?>
$to = $_REQUEST['me@emailaddress.com'];
$from = $_REQUEST['email'];
$name = $_REQUEST['name'];
$headers = "From: $from";
$subject = "Contact Form Information Request";
ini_set('sendmail_from', $from);
$fields = array();
$fields{"name"} = "Name";
$fields{"address"} = "Address";
$fields{"tel"} = "Telephone Number";
$fields{"email"} = "Email Address";
$fields{"boat"} = "Do you own your own boat";
$fields{"time"} = "How long have you owned this boat ";
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a])\n $check_msg; }
$headers2 = "From: $to";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us.
Somebody will get back to you as soon as possible, usually within 48 hours. If you have any more questions, please consult our website at www.bridge-marine.co.uk or alternatively you can call us on Tel Number";
if($from == '') {header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/error.html" );}
else {
if($name == '') {header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/error.html" );}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.thebiggestnameinmarinemarketing.com/bridgemarine/thankyou.html" );}
else
{print "We encountered an error sending your mail, please notify me@emailaddress.com";}
}
}
?>
The form page can be viewed HERE