MyHeadHurts
MyHeadHurts

Reputation: 1562

simple php, sending a form email

I just started learning php today, so exciting : p

not really sure what i am doing wrong

I got my first error

Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\lesson1\form_response.php on line 20   

 <?php
    $firstname =  $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $street =  $_POST['street'];
    $city =  $_POST['city'];
    $phonenumber = $_POST['phonenumber'];
    $email = $_POST['email'];   

    $myemail = '[email protected]'


    $email_message = "First Name: {$firstname} <br> Last Name: {$lastname} <br> Street: {$street} <br> City: {$city} <br> Phone Number: {$phonenumber} <br> Email: {email}";



    mail($myemail,'test form',$email_message);

    ?>

Upvotes: 1

Views: 205

Answers (2)

Bakudan
Bakudan

Reputation: 19492

Probably it's because you are missing a ; after $myemail = '[email protected]'

Upvotes: 1

Jason McCreary
Jason McCreary

Reputation: 73031

Forgot a semi-colon.

$myemail = '[email protected]';

Probably don't want to post your actual email...

Upvotes: 3

Related Questions