I have made a website called coodos.co, I am a newbie at php whenever someone submits the contact us form the php page opens and never closes, what I want to do is that the php code executes in the backend instead of loading a page called contact.php in front of the user,
here is my php code
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['msg'];
$to='info@coodos.co'; // Receiver Email ID, Replace with your email ID
$subject='Form Submission';
$message="Name :".$name."\n"."email:".$email."\n"."Wrote the following :"."\n\n".$msg;
$headers="From: ".$email;
if(mail($to, $subject, $message, $headers)){
exit();
}
?>