# Desperate need of help, if else statements,

**URL:** <https://forum.kirupa.com/t/desperate-need-of-help-if-else-statements/233447>\
**Category:** programming\
**Created:** [July 24, 2007, 3:41am UTC](https://forum.kirupa.com/t/desperate-need-of-help-if-else-statements/233447 "2007-07-24T03:41:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![webbcreative](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@webbcreative](https://forum.kirupa.com/u/webbcreative)\
**Post date:** [July 24, 2007, 3:41am UTC](https://forum.kirupa.com/t/desperate-need-of-help-if-else-statements/233447/1 "2007-07-24T03:41:22Z")

</div>

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!”;  
}  
?\>
