I swear this form was working before nowI just tried it recently and I get the error:
Warning: Invalid argument supplied for foreach() in /var/www/html/mail.php on line 19
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/mail.php:19) in /var/www/html/mail.php on line 50
I dont recall changing line 19...
<?php
if(isset($_POST['submit'])) {
$headers = "MIME-Version: 1.0\n"
."From: Maryland Training<mccbtn@howardcc.edu>\n";
$to = "mccbtn@howardcc.edu";
$subject = "Request Form";
$coursename_field = $_POST['coursename'];
$dates_field = $_POST['dates'];
$times_field = $_POST['times'];
$level_field = $_POST['level'];
$comments_field = $_POST['comments'];
$name_field = $_POST['name'];
$title_field = $_POST['title'];
$email_field = $_POST['email'];
$phone_field = $_POST['phone'];
$company_field = $_POST['company'];
foreach($_POST['collegelist'] as $value) {
$check_msg .= "Checked: $value\n";
}
$body =
"
Course Date: $coursename
Dates: $dates
Times: $times
Level of Training Desired: $level
Colleges Seclected:
$check_msg
Other Comments: $comments
Submitted By
Name: $name
Title: $title
Email: $mail
Phone: $phone
Company: $company
";
header('Location: [url]http://www.marylandtraining.com/sent.htm[/url]');
mail($to, $subject, $body, $headers);
} else {
echo "error!";
}
?>