hi this is a copy of my code am trying to get it to redirect to the thankyou page but it just sits at a blank screen otherwise it all works. Am i putting the header line in the wrong place ifso where do i put it or whats going on please. i have changed the php to ph incase.
mailer <?ph $myemail = "[email protected]";if(isset($_POST[‘Submit’])) {
$subject = “Registration Form”;
$name = check_input($_POST[‘Name’]);
/* check email address is valid */
$email = check_input($_POST[‘Email’], “Please enter your email address”);
if (!preg_match("/([\w-]+@[\w-]+.[\w-]+)/",$email))
{
show_error(“E-mail address not valid”);
}
$Questions = check_input($_POST[‘Questions’]);
$message = “Hello!\n Your registration form has been sent by:\n Name: $name \n Email: $email \n Qestions: $Questions\n”;
}
/* Initialise and Send email */
ini_set (“SMTP”,“something.something”);
ini_set (“sendmail_from”,"$email");
mail($myemail,$subject,$message);
header(“Location:thankyou.html”);
exit;
/* Our Functions
Check input for malicious code */
function check_input($data, $problem= ‘’)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_eror($problem);
}
return $data;
}
function show_error($myError)
{
?>
<b>Please correct the following error:</b><br />
<?ph echo $myError; ?>
<?ph
exit();
}
?>
any help please as i cant see what the problem is.