Need a little help with this PHP script
All i want is for a redirect on error ( when the first if statement is false) to a page I have created myself (for example error.html) instead i am just getting a php page with an error (highlighted in bold), i'm guessing that the redirect code has to go here but not sure of what I have to enter to achieve the result.
If the first 'if' statement is true i want the script to go ahead and execute the other 'if' statement to submit the email
<?php
include_once("captcha.php");
if (WSP_CheckImageCode() != "OK") {
die('You have entered the code incorrectly');
}if(isset($_POST['submit'])) {
$to = "info@blabla.com";
$subject = "Information";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$phone_field = $_POST['phone'];
$info_field = $_POST['info'];
$body = "Name: $name_field\n E-Mail: $email_field\n Phone: $phone_field\n Info: $info_field\n";
echo header('Location: submit.html');
mail($to, $subject, $body);
} else {
echo "You do not have permission to access this file";
}
?>
Any help would be great cheers