Hi,
Im getting these once ive clicked “Submit”
Notice: Undefined index: check in /home/fhlinux172/b/*****.com/user/htdocs/mailer.php on line 21
Warning: Invalid argument supplied for foreach() in /home/fhlinux172/b/best******.com/user/htdocs/mailer.php on line 21
Notice: Undefined variable: check_msg in /home/fhlinux172/b/best*****.com/user/htdocs/mailer.php on line 27
Notice: Undefined variable: confrimemail_field in /home/fhlinux172/b/best*****.com/user/htdocs/mailer.php on line 27
CODE:
<?php
if(isset($_POST[‘submit’])) {
$to = “info@*****.co.uk”;
$subject = “From Best
$name_field = $_POST[‘name’];
$email_field = $
$confirmemail_field = $_POST[‘confirmemail’];
$message = $
$dropdown = $_POST[‘drop_down’];
foreach($_POST[‘check’] as $value) {
$check_msg .= “Checked: $valuen”;
}
//You needed a from header.
$headers = “From: “.$email_field.” n”;
$body = “From: $name_fieldn E-Mail: $email_fieldn $check_msg Confirm E-mail: $confrimemail_fieldn `Drop-Down: $dropdownn Message:n $messagen”;
mail($to, $subject, $body, $headers);
echo “Data has been submitted to $to!”;
} else {
echo “blarg!”;
}
?>
I dont understand PHP that much and i deffiantly dont understand why it is giving me Undifined Variables.
Hope you can help.
Crast?