I have tried to create a simple form with the html and php code shown below. HTTP ERROR 500 keeps occurring when I try run the page. Please advise how I am able to receive an email when a form is submitted.Thank you in advance.
<form action="action_page.php" method="post" target="_blank">
<div class="info">
<input class="name" type="text" name="name" placeholder="Full name">
<input type="text" name="email" placeholder="Email">
<input type="text" name="number" placeholder="Phone number">
<input type="text" name="date" placeholder="Today's date"><br>
<select id="product" name="product">
<option value="LENOVO THINKPAD T460 LAPTOP">LENOVO THINKPAD T460 LAPTOP-
R4500</option>
<option value="LENOVO THINKPAD T450 LAPTOP">LENOVO THINKPAD T450 LAPTOP-
R4000</option>
<option value="LENOVO THINKCENTRE M93 DESKTOP">LENOVO THINKCENTRE M93 DESKTOP-
R3250</option>
</select>
<input type="number" name="amount" placeholder="Quantity" min="0"><br>
<button><input type="submit" value="Submit" ></button>
</div>
</form>
<?php
if (isset(S_POST{'submit'})){
$name = $_POST['name'];
$email = $_POST['email'];
$number = $_POST['number'];
$product = $_POST['product'];
$amount = $_POST['amount'];
$to='amy@ethers.co.za';
$subject='Form Submission';
$message="Name: ".$name."\n"."Email: ".$email."\n"."Product: ".$product."\n"."Amount:
".$amount.
$headers="From: ".$email;
if(mail($to, $subject, $message,
$headers)){
echo "<h1>Sent Succesfully! Thank You!</h1>";
}
else{
echo "Something went wrong";
}
}
?>