0

I am trying to get this contact form to work but I can't seem to get it working. I'm following this tutorial https://www.youtube.com/watch?v=6q7ndD0rt2s and I believe I have done everything right, but it keeps saying:

Parse error: syntax error, unexpected end of file in /home1/svcck/public_html/contact.php on line 80. (Line 80 is the very bottom of my code).

Could someone please help me get it working, or notify me of any errors in my code? Thanks.

<?php

    $to = 'email@mail.com';
    $subject = 'this came from your Chille';

    $name = $_POST['name'];
    $email = $_POST['email'];
    $topic = $_POST['topic'];
    $message = $_POST['message'];

    $body = <<<EMAIL

    Hi! My name is #name, and my topic is $topic

    $message

    From $name
    Oh ya, my email is #email

        EMAIL;

        $header = "From: $email";

        if($_POST) {
            if($name == '' || $email == '' || $message == '') {
                $feedback = 'fill out all the fields!';
            }else{
                mail($to, $subject, $body, $header)
            $feedback = "Thanks for emailing us!";
            }

        }



    ?>

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>This is my site!</title>
    <link rel='stylesheet' href='contact.css' type='text/css' media='all'>
    </head>

    <body>


        <p id="feedback"><?php echo $feedback; ?></p>
            <form action="?" method="post">
                <ul>
                    <li>
                        <label for="name">Name:</label>
                        <input type="text" name="name" id="name" />
                    </li>
                    <li>
                        <label for="email">Email:</label>
                        <input type="text" name="email" id="email" />
                    </li>
                    <li>
                        <label for="topic">Topic:</label>
                        <select id="topic" name="topic">
                            <option value="Ponies">Ponies</option>
                            <option value="Mexicans">Mexicans</option>
                            <option value="Weiner">Weiner</option>
                        </select>
                    </li>
                    <li>
                        <label for="message">Message:</label>
                        <textarea id="message" name="message" cols="42" rows="9"></textarea>
                    </li>
                    <li>
                        <input type="submit" value="Submit!"></li>
                    </li>
                </ul>
            </form>

    </body>
    </html>
Jay
  • 1
  • 3
  • 1
    The closing heredoc marker `EMAIL;` can't be indented. – mario Jul 04 '15 at 12:20
  • @mario I don't understand what you mean, sorry. could you please display what you mean. thanks. – Jay Jul 04 '15 at 12:24
  • Made an example for you: [Unexpected $end: Indented HEREDOC markers](http://stackoverflow.com/a/29500670) – mario Jul 04 '15 at 12:28

0 Answers0