Forum Moderators: coopster
the form has input fields butto label them on the email i have to use hidden inputs
example
<?
// send form results through email
$recipient = "##@##.com";
$subject = "Booking Enquiry";
$forminfo =
(
$_POST['h1'] . "\r" .
$_POST['surname'] . "\r" .
$_POST['h2'] . "\r" .
$_POST['contact'] . "\r" .
$_POST['h4'] . "\r" .
$_POST['date'] . "\r" .
$_POST['h5'] . "\r" .
$_POST['time'] . "\r" .
$_POST['h6'] . "\r" .
$_POST['adults'] . "\r" .
$_POST['h7'] . "\r" .
$_POST['kids'] . "\r" .
$_POST['h8'] . "\r" .
$_POST['comments'] . "\r" .
$_POST['email'] . "\r" .
date("d-M-Y") . "\r\n\n");
$formsend = mail("start", "$recipient", "$subject", "$forminfo");
?>
But i dont want to use the hidden feilds, i would like it to show the name of the input feild then the value, and if no value then not display it in the email
Can anyone help?
Thanks in advance
Maybe something like this to construct your email message body:
$message = '';
foreach($_POST as $name => $value)
$message .= $name . ': ' . $value . "\n";
Try something like that and see what you get.