I have a problem because I'm new to PHP. I wrote a simple contact form, but after sending a message (everything works fine), it takes me to a blank page. Is there any way to go back to the contact.html
page and show the message "sent successfully"?
<?php
if(isset($_POST['submit'])) {
$to ='contact@centurioagency.com';
$subject =$_POST['subject'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$message = "
<html>
<head>
<title>$_POST['subject']</title>
</head>
<body>
<b>Person: </b> ".$_POST['name']." </br>
<b>Email: </b> ".$_POST['email']." </br>
<b>Message: </b> ".$_POST['detail']." </br>
</body>
</html>" ;
mail($to, $subject, $message, $headers);
}
?>