For some strange unbeknown reason my contact form has just stopped working in that it no longer submits any of the form details to the email address I have set up in the script.
The contact form does re-direct to the thanks.htm file once the approapriate field data has been completed and then submitted, its just it ends at that point…!
I tested the PHP / contact form on several occasions whilst live and on every occasion I had the form details come through to my email account, so Im at a loss as to why it has just stopped ?
My code for the PHP and HTML is as follows should anyone anyone be kind enough to look at it : (Domain is also www.bfdesigns.co.uk)
<?php
/* Set e-mail recipient */
$myemail = "ben@bfdesigns.co.uk";
$company = ($_POST['company']);
$firstname = ($_POST['firstname']);
$email =($_POST['email']);
$enquiry =($_POST['enquiry']);
$thanksurl = "http://bfdesigns.co.uk/thanks.htm" ;
$errorurl = "http://bfdesigns.co.uk/error.html" ;
/*Redirects the user to the error page if JS is disabled and the form is submitted*/
if(empty($firstname))
{
header('Location: error.html');
exit();
}else
{
/* Redirects the visitor to the thanks page */
header('Location: thanks.htm');
exit();
}
/* Prepare the message for the e-mail */
$message = "You have a new Web design enquiry from:
Company name: $company
Client name: $firstname
Clients e-mail: $email
Clients message: $enquiry
End of message
";
/* Sends the message using mail() function */
mail($myemail, $email, $message);
?>
<form action="contact.php" method="post" name="contactForm" onsubmit="return validateForm()">
<fieldset>
<p><span>*</span> Must be completed to submit the form</p>
<label>Company:</label>
<input type="text" name="company"/>
<label id="completeField"><span>*</span> Name:</label>
<input type="text" name="firstname" id="firstname"/>
<label>Email:</label>
<input type="text" name="email"/>
<label>Enquiry:</label>
<textarea name="enquiry" rows="4" cols="10"></textarea>
<input type="submit" value="Submit" id="submit" />
</fieldset>
</form>