# Please help- php form problem

**URL:** https://forum.kirupa.com/t/please-help-php-form-problem/298711
**Category:** programming
**Created:** [October 23, 2009, 1:35pm UTC](https://forum.kirupa.com/t/please-help-php-form-problem/298711 "2009-10-23T13:35:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neopets3010](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@neopets3010](https://forum.kirupa.com/u/neopets3010)
#### Post date: [October 23, 2009, 1:35pm UTC](https://forum.kirupa.com/t/please-help-php-form-problem/298711/1 "2009-10-23T13:35:29Z")

</div>

I’m new to coding and the likes. I set up a form using [http://www.kirupa.com/web/php\_contact\_form4.htm](http://www.kirupa.com/web/php_contact_form4.htm) and it worked for the basic info. However when I put in all the info I needed it doesn’t send the email ordisplay anything once you hit submit.

My contact.html form is:

\<form method=“POST” action=“mailer.php”\>

\<table border=“0”\>

\<tr\>  
\<td\>  
Name  
\</td\>  
\<td\>  
\<input type=“text” name=“name” value=“type name here” /\>  
\</td\>  
\</tr\>

\<tr\>  
\<td\>  
Contact Number  
\</td\>  
\<td\>  
\<input type=“text” name=“contact” value=“type number here” /\>  
\</td\>  
\</tr\>

\<tr\>  
\<td\>  
Email  
\</td\>  
\<td\>  
\<input type=“text” name=“email” value=“type email here” /\>  
\</td\>  
\</tr\>

\<tr\>  
\<td\>  
Required date  
\</td\>  
\<td\>  
\<input type=“text” name=“date” value=“dd/mm/yy” /\>  
\</td\>  
\</tr\>

\<tr\>  
\<td\>  
Please select  
\</td\>  
\<td\>  
\<!–pull-down menu–\>  
\<select name=“drop\_down”\>  
\<option value=“school ball/disco”\>School Ball/Disco\</option\>  
\<option value=“birthday”\>Birthday\</option\>  
\<option value=“party”\>Party\</option\>  
\<option value=“other”\>Other\</option\>  
\</select\>  
\</td\>  
\</tr\>

\<tr\>  
\<td\>  
Style of Music  
\</td\>  
\<td\>  
\<textarea name=“music” rows=“5” cols=“40”\>what kind of music do you want to be played  
\</textarea\>  
\</td\>  
\</tr\>

\<tr\>  
\<td colspan=“2”\>  
\<input type=“submit” value=“Send” name=“submit”/\>  
\</td\>  
\</tr\>

\</table\>

\</form\>

and the mailer.php:

\<?php  
if(isset($\_POST[‘submit’])) {

$to = "neopets3010@hotmail.com";  
$subject = “booking”;  
$name\_field = $\_POST[‘name’];  
$contact\_field = $\_POST{‘contact’};  
$email\_field = $\_POST[‘email’];  
$date\_field = $\_POST[‘date’];  
$drop\_down = $\_POST[‘drop\_down’];  
$music = $\_POST[‘music’];

```
foreach($_POST['check'] as $value) {
    $check_msg .= "Checked: $value

```

";

$body = "From: $name\_field  
E-Mail: $email\_field  
Contact number: $contact\_field  
Drop-Down: $drop\_down  
Date required: $date\_field  
Music Style: $music  
";

echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);

} else {

echo “We have encountered an error”;

}  
?\>

Please help me.  
Thanks in advance
