Hi,

I have created a contact form in html and .php. When I click on the submit button it is giving me an error "Internal server error"

check out my website www.yourgoal.co.in for contact form at the end of each page.

Code that I used to create the form (HTML & PHP) is

HTML code

<section class="one_quarter lastbox">
<h2 class="title">Contact Us</h2>
<form method="post" action="contact.php">
<fieldset>
<legend>Contact Form:</legend>
<label for="cf_name">Name:</label>
<input type="text" name="cf_name" id="cf_name" value="" style="background-color:#FFF">
<label for="cf_email">Email:</label>
<input type="text" name="cf_email" id="cf_email" value="" style="background-color:#FFF">
<label for="cf_subject">Subject:</label>
<input type="text" name="cf_subject" id="cf_subject" value="" style="background-color:#FFF">
<label for="cf_message">Message:</label>
<textarea name="cf_message" id="cf_message" cols="45" rows="10" style="background-color:#FFF"></textarea>
<button type="submit" value="send">Submit</button>
</fieldset>
</form>
</section>

PHP code is below

<?

$your_email = "admin@yourgoal.co.in";

$headers= "From: ".$_POST['name']." <".$_POST['email'].">\r\n";
$headers.='Content-type: text/html; charset=utf-8';
mail($your_email, $_POST['subject'], "
<html>
<head>
<title>Contact Message</title>
</head>
<body>
Contact Message<br><br>
Name : ".$_POST['name']."<br>
Email : ".$_POST['email']."<br>
<?php /*?>Telephone : ".$_POST['telephone']."<br><br><?php */?>
Subject : ".$_POST['subject']."<br>
Message : <br>".$_POST['message']."<br>
</body>
</html>" , $headers);
header("Location: ./index.htm?page=Services.htm");
?>