I am a total beginner, so i have downloaded this php file from Kirupa. and i cant get it to work with my site.
everytime i hit submit i got the error message -“blarg”
but recently it doesnt give me a confirmation or an error, just a blank page…
i dont know where the problem is if anyone could help it would be greatly appreciated.
i have 6 selections that have drop down menus, not sure if those are done correctly…
and i know the foreach isnt correct, i have been grasping at straws on that one.
<?php
if(isset($_POST[‘submit’])) {
$to = "chris@tatepublishing.com";
$subject = "Narration Selection from $name";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$book_field = $_POST['book'];
$words_field = $_POST['words'];
$option = $_POST['radio'];
$josh = $_POST['drop_down'];
$thomas = $_POST['drop_down'];
$rachael = $_POST['drop_down'];
$eva = $_POST['drop_down'];
$mike = $_POST['drop_down'];
$melissa = $_POST['drop_down'];
$main_field = $_POST['main'];
$other_field = $_POST['other'];
$special_field = $_POST['special'];
foreach($_POST['drop_down'] as $value) {
$check_msg .= "drop_down: $value
";
}
$body = "From: $name_field
eMail: $email_field
Option: $option
Drop-Down: $dropdown
josh: $josh
thomas: $thomas
rachael: $rachel
eva: $eva
mike: $mike
melissa: $melissa
main: $main_field
other: $other_field
special: $special_field
";
echo "Congratulations $name_field!";
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
?>