Trying to complete contact page. Would like message to refresh. Here’s what I have thus far.
<html>
<head>
<style type="text/css">
</head>
<body>
<br>
<?php
if(isset(_POST['submit'])){
$name = htmlspecialchars($_POST['name']);
$subject = htmlspecialchars($_POST['subject']);
$from = htmlspecialchars($_POST['mail'];
$message = htmlspecialchars($_POST['message'];
$to = "[email protected]";
$headers = "From:" . $from; mail($to,$subject,$message, $headers);
$txt = "You have received an email from".$name.".\n\n.$message;
"<meta http-equiv='Refresh' content='0; URL=contact.php'>";
echo "<b>Message successfully sent</b>";
mail($to,$subject,$txt,$headers);
}
?>
<br>
<div align="center">
<form action="test.php" method="post">
<input type="text" name="name" placeholder="name"><br /><br />
<input type="text" name = "email" placeholder="email"><br /><br />
<input type="text" name="subject" placeholder="subject"><br /><br />
<textarea name="message" cols="45" rows="9" placeholder="Message..."></textarea>
<br />
<br />
<input type="image" src="sendbutton.jpg" name="submit"></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
/p>
</div>
</body>
</html>