# Php form

**URL:** <https://forum.kirupa.com/t/php-form/282535>\
**Category:** Uncategorized\
**Created:** [February 23, 2009, 2:10pm UTC](https://forum.kirupa.com/t/php-form/282535 "2009-02-23T14:10:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sl333py](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@sl333py](https://forum.kirupa.com/u/sl333py)\
**Post date:** [February 23, 2009, 2:10pm UTC](https://forum.kirupa.com/t/php-form/282535/1 "2009-02-23T14:10:30Z")

</div>

Hi Guys,

I’m having a bit of a headache trying to make a form work on my website.

The form is here [www.realmealdeal.co.uk/form.php](http://www.realmealdeal.co.uk/form.php)

I worked through the tutorial on the website here [http://www.kirupa.com/web/php\_contact\_form.htm](http://www.kirupa.com/web/php_contact_form.htm)

but I’ve messed the code up somehow on line 20. I’m a bit off a dumb\*ss when it comes to even simple code stuff but I thought i’d give it a try as the tutorial was well explained and the easiest i’ve found on the trawl of the net. Even so i’ve mucked it up 😏

Here’s the code bit off php I did

\<?php  
if(isset($\_POST[‘submit’])) {  
$to = “[ianmnicholls@gmail.com](mailto:ianmnicholls@gmail.com)”;  
$subject = “Real Meal Deal”;  
$name\_field = $\_POST[‘Pub/Restaurant’];  
$email\_field = $\_POST[‘website’];  
$email\_field = $\_POST[‘offer heading’];  
$message = $\_POST[‘offer copy’];  
$email\_field = $\_POST[‘street/phone’];  
$email\_field = $\_POST[‘valid’];  
$email\_field = $\_POST[‘email’];

$body = “From: $name\_field  
Pub/Restaurant: $email\_field  
website: $email\_field  
offer heading  
$offer copy” $email\_field  
street/phone: $email\_field  
valid: $email\_field  
email:;  
echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);  
} else {  
echo “blarg!”;  
}  
?\>

When I fill in the form and click send it comes up with this

Parse error: syntax error, unexpected T\_VARIABLE in /homepages/9/d187402498/htdocs/real/mailer.php on line 20

on the mailer page  
[http://www.realmealdeal.co.uk/mailer.php](http://www.realmealdeal.co.uk/mailer.php)

If it’s not too much trouble could someone please tell me where i’m going wrong as it’s hurting my head!

Thanks
