Contact form syntax error

I’m sure this is a very simple fix and I’m just not seeing it… I’m trying to get this form to work and I keep getting an error. Parse error: syntax error, unexpected T_VARIABLE in /home/content/70/7210770/html/beta/contact.php on line 5

here is the code:

<form method="post" action="contact.php"> <label for="name">Name:</label> <input type="text" name="name" id="name" required placeholder="Name" /> <label for="name">Subject:</label> <input type="text" name="subject" id="subject" required placeholder="Subject" /> <label for="email">Email:</label> <input type="email" name="email" id="email" required placeholder="[email protected]" /> <label for="message">Message:</label> <textarea name="message" id="message" required></textarea> <input type="submit" value="Send Message" /> </form>

[php]<?php
$to = "[email protected]";
$subject = “Contact Us”;
$name = $_REQUEST[ ‘name’]
$email = $_REQUEST[‘email’] ;
$message = $_REQUEST[‘message’] ;
$headers = “From: $email”;
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print “Your mail was sent successfully”; }
else
{print “We encountered an error sending your mail”; }
?> [/php]

Hi Mike,

You are missing a semicolon at the end of line 4 of your contact.php code. I would also remove the extra space between your left bracket and the single quote. It should be:[php]$name = $_REQUEST[‘name’] ;[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service