webbcreative
July 23rd, 2007, 11:41 PM
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\n";
}
$body = "From: $name_field\n eMail: $email_field\n Option: $option\n Drop-Down: $dropdown\n josh: $josh\n thomas: $thomas\n rachael: $rachel\n eva: $eva\n mike: $mike\n melissa: $melissa\n
main: $main_field\n other: $other_field\n special: $special_field\n";
echo "Congratulations $name_field!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
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\n";
}
$body = "From: $name_field\n eMail: $email_field\n Option: $option\n Drop-Down: $dropdown\n josh: $josh\n thomas: $thomas\n rachael: $rachel\n eva: $eva\n mike: $mike\n melissa: $melissa\n
main: $main_field\n other: $other_field\n special: $special_field\n";
echo "Congratulations $name_field!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>