# PHP form parse error

**URL:** <https://forum.kirupa.com/t/php-form-parse-error/270827>\
**Category:** programming\
**Created:** [September 15, 2008, 1:53am UTC](https://forum.kirupa.com/t/php-form-parse-error/270827 "2008-09-15T01:53:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aewgliriel](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@aewgliriel](https://forum.kirupa.com/u/aewgliriel)\
**Post date:** [September 15, 2008, 1:53am UTC](https://forum.kirupa.com/t/php-form-parse-error/270827/1 "2008-09-15T01:53:05Z")

</div>

Hi, guys, I’m hoping someone can help me. I read the tutorial on the php form, and i carefully followed the directions, but apparently i did something wrong, because when I went to test it, I got this error:

**Parse error** : parse error, unexpected T\_ELSE in **/home/content/a/s/t/astorcreations/html/testsite/mailer.php** on line \*\*15

\*\*The PHP code I’m using looks like this:

```php

<?php
if(isset($_POST['submit'])) {
    $to = "info@a-stor-creations.com";
    $subject = "Contact From A Stor Creations Website";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $comments = $_POST['comments'];
    foreach($_POST['check'] as $value) {
    $check_msg .= "Checked: $value
";

    $body = "From: $name_field
 E-Mail: $email_field
 Inquiry: $check_msg
 Message:
 $comments";

    echo "Data has been submitted to $to!";
    mail($to, $subject, $body);
    
} else {
    echo "blarg!";
}
?>

```

and my form itself is here: [http://www.a-stor-creations.com/testsite/contact.html](http://www.a-stor-creations.com/testsite/contact.html)

I don’t work with PHP much, though I’m in web design for my job. I have no idea where to begin to fix this, but any help or insight you guys could give me would be greatly appreciated.
