And here is the code to make the email send.
I know tht basically I need to flesh out the $msg and I probably have to write out each echo rather that the foreach thats there right now but I don't know how to make the table actually work. I've tried it but it tells me there is an error on the line that the table starts...
(I'm not going to color the code 'cause it'd take a while and I want ot get this post out...)
<?php
if ($_SERVER['REQUEST_METHOD']=="POST"){
if (strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])>7 ||
!strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']))
die("Your computer sucks");
$msg="The following has been submitted:\n";
foreach($_POST as $key => $val){
if (is_array($val)){
$msg.="Item: $key\n";
foreach($val as $v){
$v = stripslashes($v);
$msg.=" $v\n";
}
} else {
$val = stripslashes($val);
$msg.="$key: $val\n";
}
}
$recipient="myemail@mine.com";
$from="Reservation Page";
$subject="Reservation Made";
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: $from\r\n";
error_reporting(0);
if (mail($recipient, $subject, $msg, $headers)){
echo "Reservation successfully sent.</p>\n";
echo nl2br($input);
} else
echo "An error occurred and the message could not be sent.";
} else
echo "Bad request method";
?>