PHP Contact Form

Hi,

I am new to PHP, I am trying to create a contact form using html and php. I found the tutorial on this website to create one. Problem is, whenever I submit the form it displays the php code in the browser. Any help on how to resolve this would be greatly appreciated.

The code I have is,

 
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="mailer.php">
 Name:
 <input type="text" name="name" size="19"><br>
 <br>
 E-Mail:
 <input type="text" name="email" size="19"><br>
 <br>
 
 <input type="checkbox" name="check[]" value="blue_color"> Blue<br>
 <input type="checkbox" name="check[]" value="green_color"> Green<br>
 <input type="checkbox" name="check[]" value="orange_color"> Orange<br>
 <br>
 <input type="radio" value="yes" name="radio"> YES<br>
 <input type="radio" value="no" name="radio"> NO
 <br>
 <br>
 <select size="1" name="drop_down">
 <option>php</option>
 <option>xml</option>
 <option>asp</option>
 <option>jsp</option>
 </select><br>
 <br>
 Message:<br>
 <textarea rows="9" name="message" cols="30"></textarea><br>
 <br>
 <input type="submit" value="Submit" name="submit">
</form>
</body>
</html>

 
<?php
if(isset($_POST['submit'])) {
 $to = "[email protected]"; 
 $subject = "Form Tutorial";
 $name_field = $_POST['name'];
 $email_field = $_POST['email'];
 $message = $_POST['message'];
 $option = $_POST['radio'];
 $dropdown = $_POST['drop_down'];
 foreach($_POST['check'] as $value) {
  $check_msg .= "Checked: $value
";
 }
 
 $body = "From: $name_field
 E-Mail: $email_field
 $check_msg Option: $option
 Drop-Down: $dropdown
 Message:
 $message
";
 echo "Data has been submitted to $to!";
 mail($to, $subject, $body);
 
} else {
 echo "blarg!";
}
?>

Thanks

Towsie