My php form throws the error up and no email delivered

Ideas would be most welcome

<?php
if(isset($_POST[‘email’])) {

// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "test@test.co.uk";
$email_subject = "Story Submission";
 
 
function died($error) {
    //error code can go here
    echo "We are very sorry, but there was an error or errors found with the form you submitted. ";
    echo "These errors appear below.&lt;br /&gt;&lt;br /&gt;";
    echo $error."&lt;br /&gt;&lt;br /&gt;";
    echo "Please go back and fix these errors.&lt;br /&gt;&lt;br /&gt;";
    die();
}
 
// validation expected data exists
if(!isset($_POST['first_name']) ||
    !isset($_POST['last_name']) ||
    !isset($_POST['email']) ||
    !isset($_POST['telephone']) ||
    !isset($_POST['comments'])) {
    died('We are sorry, but there appears to be a problem with the form you submitted.');       
}
 
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
 
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/';

if(!preg_match($email_exp,$email_from)) {
$error_message .= ‘The Email Address you entered does not appear to be valid.<br />’;
}
$string_exp = “/[1]+$/”;
if(!preg_match($string_exp,$first_name)) {
$error_message .= ‘The First Name you entered does not appear to be valid.<br />’;
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= ‘The Last Name you entered does not appear to be valid.<br />’;
}
if(strlen($comments) < 2) {
$error_message .= ‘The Comments you entered do not appear to be valid, Or long enough.<br />’;
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.

";

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}
 
$email_message .= "First Name: ".clean_string($first_name)."\

";
$email_message .= "Last Name: “.clean_string($last_name).”
";
$email_message .= "Email: “.clean_string($email_from).”
";
$email_message .= "Telephone: “.clean_string($telephone).”
";
$email_message .= "Comments: “.clean_string($comments).”
";

// create email headers
$headers = 'From: '.$email_from."\r
“.
'Reply-To: '.$email_from.”\r
" .
‘X-Mailer: PHP/’ . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>

<!-- include your own success html here –>

Thank you for contacting us with your story. We will be in touch shortly.
<?php
}
?>


  1. A-Za-z .'- ↩︎

Hey James, could you show us your HTML too?

Also, what error do you get?

The error i get is just the error text in the form no actualy error code:-
We are very sorry, but there was an error or errors found with the form you submitted. These errors appear below.

We are sorry, but there appears to be a problem with the form you submitted.

Please go back and fix these errors.

HtML :-

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”
http://www.w3.org/TR/html4/strict.dtd”>

<html xmlns=“http://www.w3.org/1999/xhtml” lang=“en”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Sell Your Story at Pep Publishing</title>
<meta name=“” content=“contact details” />
<!-- Date: 2012-08-30 –>
<link rel=StyleSheet href=“css/styles.css” TYPE=“text/css”>
<style type=“text//css”></style>
</head>

	&lt;body&gt;

<nav>
<ul>
<li><a href=“index.html”>Home</a></li>
<li><a href=“contact.html” rel=“shadowbow”>Contact</a>
<ul>
<li><a href=“#”>How To Find us</a></li>
<li><a href=“#”>Sell Us A Story</a></li>
<li><a href=“#”>Email Us</a></li>
<li><a href=“#”>Work For PEP</a></li>
</ul>
</li>
<li><a href=“#”>Magazines</a>
<ul>
<li><a href=“www.loveitmagazine.co.uk”>LoveIt</a></li>
<li><a href=“www.fullhousemagazine.co.uk”>Full House!</a></li>
</ul>
</li>
<li><a href=“Advertise.html”>Advertise</a></li>
</ul>
</nav>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

	&lt;form name="storyform" method="post" action="send_form_email_story.php"&gt;

<div>
<h1>Sell Us Your Story:</h1>
<label>
<span>First Name</span><input id=“first_name” type=“text” name=“name” />
</label>

<label>
<span>Last Name</span><input id=“last_name” type=“text” name=“name” />
</label>

<label>
<span>Email Address</span><input id=“email” type=“text” name=“email” />
</label>

<label>
<span>Telephone</span><input id=“telephone” type=“text” name=“telephone” />
</label>

<label>
<span>Your Story</span>
<br />
<textarea id=“comments” name=“comments”></textarea>

<input type=“submit” value=“Submit”>
</label>

</div>
</form>

	&lt;/body&gt;

</html>

You need to update the name attributes of your first and last name fields

<label>
<span>First Name</span><input id="first_name" type="text" name="name" />
</label>

<label>
<span>Last Name</span><input id="last_name" type="text" name="name" />
</label>

Should be

<label>
<span>First Name</span><input id="first_name" type="text" name="first_name" />
</label>

<label>
<span>Last Name</span><input id="last_name" type="text" name="last_name" />
</label>

thanks didnt notice that ! something so small !! sometimes just need a 2nd set of eyes thanks a lot guys!