Here’s my code for a simple form I have:
<?php
if(isset($_POST['submit'])) {
$to = "my@emailcom";
$subject = "Test";
$name_field = $_POST['name'];
$company_field = $_POST['company'];
$message = $_POST['feedback'];
$body = "From: $name_fieldn Company: $company_fieldn Message:n $feedback";
echo "Your message has been sent to $to";
mail($to, $subject, $body);
} else {
echo "Oops!";
}
?>
My question is, How can have the user be taken back to a certain page after the submit button is clicked, rather than to a blank page with the “Your message has been sent to” text?
I’ve looked for a solution but I can’t seem to find anything.