# Kirupa PHP tutorial contact form

**URL:** <https://forum.kirupa.com/t/kirupa-php-tutorial-contact-form/251522>\
**Category:** programming\
**Created:** [February 9, 2008, 4:19pm UTC](https://forum.kirupa.com/t/kirupa-php-tutorial-contact-form/251522 "2008-02-09T16:19:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagreen78](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jagreen78](https://forum.kirupa.com/u/jagreen78)\
**Post date:** [February 9, 2008, 4:19pm UTC](https://forum.kirupa.com/t/kirupa-php-tutorial-contact-form/251522/1 "2008-02-09T16:19:00Z")

</div>

I followed the kirupa tutorial on building a contact form and using the mailer.php last night. The problem is that it only sends the information collected 3 out of 6 times.

Is there any reason this is happening? I’m not getting any errors…

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

```
$to = "jagreen78@gmail.com"; 
$subject = "A message from the web site form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$company_field = $_POST['address'];
$city_field = $_POST['city'];
$state_field = $_POST['state'];
$zip_field = $_POST['zip'];
$message = $_POST['message'];
//$option = $_POST['radio'];
//$dropdown = $_POST['drop_down'];

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

```

";  
}

```
$body = "From: $name_field

```

E-Mail: $email\_field  
Company Address: $company\_field  
City: $city\_field  
State: $state\_field  
Zip: $zip\_field  
They are contacting us for the following reason: $check\_msg  
Message:  
$message  
";

```
//echo "Thanks for your email.";

mail($to, $subject, $body);

```

} else {  
echo “You did not complete the form!”;  
}

?\>
