# Problems with mailer.php - Tutorial "Contact Form - The PHP Code"

**URL:** <https://forum.kirupa.com/t/problems-with-mailer-php-tutorial-contact-form-the-php-code/283468>\
**Category:** programming\
**Created:** [March 6, 2009, 3:48pm UTC](https://forum.kirupa.com/t/problems-with-mailer-php-tutorial-contact-form-the-php-code/283468 "2009-03-06T15:48:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabi\_1980](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fabi\_1980](https://forum.kirupa.com/u/fabi_1980)\
**Post date:** [March 6, 2009, 3:48pm UTC](https://forum.kirupa.com/t/problems-with-mailer-php-tutorial-contact-form-the-php-code/283468/1 "2009-03-06T15:48:10Z")

</div>

Hello,

I’m a graphic designer and I was searching a quick and easy solution to a brief PHP form, when I found your tutorial “[FONT=Verdana][SIZE=4][COLOR=#003366]Contact Form - The PHP Code[/COLOR][/SIZE][/FONT]”. It’s perfect for what I’m looking for, but I need a little help to solve a problem.

In your form example, the variables are Name, Email and Message, right? Instead, mine would be 5 variables (text fields), like this:

Name  
E-mail  
Phone number  
Date  
Insurance Type

Besides, there are two checkboxes like this:  
[] I’m already a Senzala Insurance Client  
[] I’m already a Senzala Buildings Client

I don’t know how to include the phone number, date and insurance type on the php code, so I did like this:

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

```
$to = "my mail"; 
$subject = "Form Tutorial";
$name_field = $_POST['nome'];
$email_field = $_POST['email'];
$message = $_POST['telefone','data','tipo'];

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

```

";  
}

```
$body = "From: $name_field

```

E-Mail: $email\_field  
Message:  
$message  
$check\_msg";

```
echo "Data has been submitted to $to!";
mail($to, $subject, $body);

```

} else {  
echo “blarg!”;  
}  
?\>

I’m sorry, but I really don’t know how to do this… is that right? Could anybody help me, urgently?  
Thanks a lot!
