Hi guys,
Hope you're all well. A quick question in regards to a callback form I have designed. The form submits fine and I receive the email but the user is not redirected to the thank you page after they have submitted the request.
<?php
// Callback form
if (isset($_POST['name'])&&$_POST['telephone']!='')
{
$to_email='info@mydomain.co.uk';
$name=$_POST['name'];
$phone=$_POST['telephone'];
$option1='';if ($_POST['dedicated-server']!='') $option1=$_POST['dedicated-server'];
$option2='';if ($_POST['server-management']!='') $option2=$_POST['server-management'];
$option3='';if ($_POST['server-colocation']!='') $option3=$_POST['server-colocation'];
$option4='';if ($_POST['online-backup']!='') $option4=$_POST['online-backup'];
$option5='';if ($_POST['reseller-affiliate']!='') $option5=$_POST['reseller-affiliate'];
$option6='';if ($_POST['other-enquiry']!='') $option6=$_POST['other-enquiry'];
$time1='';if ($_POST['time-hour']!='') $time1=$_POST['time-hour'];
$time2='';if ($_POST['time-minutes']!='') $time2=$_POST['time-minutes'];
$from = $name;
$body = "<html><body>Request a Callback Enquiry<br><br>
Name: ".$name."<br>
Phone Number: ".$phone."<br>
Enquiry Type: ".$option1."; ".$option2."; ".$option3."; ".$option4."; ".$option5."; ".$option6."<br>
Time to Callback: ".$time1.":".$time2;
$subject="Request a Callback Enquiry";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From: <'.$from.'>' . "\r\n";
$result=false;
$result=mail($to_email, $subject, $body, $headers);
header('Location: /request-a-callback-thank-you.html');
}
?>
Any ideas as to where I am going wrong with the code? Thanks in advance and I look forward to hearing back from you.
Matthew