I using simple form for input to send email with php script during execution of web shows me script php error with all php code I am using https://replit.com how can I fix this problem
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="preload" href="script.js" as="script">
<link rel="reload" href="email.php" as="script">
</head>
<body>
<div id="form-container">
<form action="email.php" id="form1" method="post">
<label class="fname">Your Name</label><br>
<input id="fname" type="input" name="fname"></input><br>
<label class="pnum">Phone</label><br>
<input id="pnum" type="input" name="pnum"></input><br>
<button id="subbttn" type="submit" onclick="test1()">Submit</button>
</form>
<?php
if(isset($_POST["submit"])){
$fname =$_POST['fname'];
$pnum =$_POST['pnum'];
$to='[email protected]';
$header = "From:[email protected]. \r\n";
$subject='form Submission';
$message="Name:".$fname "phone" .$pnum;
if (!mail($to, $subject, $message, $headers)) {
echo "Sending Failed";
}
else{
echo "Your Message has been send";
}
}
}
?>