<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a PHP script to create a simple contact form
<|im_end|>
<|im_start|>assistant
<?php
if(isset($_POST['submit'])){
 
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailFrom = $_POST['email'];
$message = $_POST['message'];

$mailTo = "example@gmail.com";
$headers = "From: ".$mailFrom;
$txt = "You have received an email from ".$name.".\n\n".$message;
 
mail($mailTo, $subject, $txt, $headers);
header("Location: index.php?mailsend");
}
?><|im_end|>
