The below form works just fine but instead of echoing “Your E-mail has been sent” on the same page, I would like to redirect the user to a thankyou.html page instead. I have tried to do a redirect with ob_start/ob_flush to get around the “headers already sent error” but I didnt do that correctly. Any ideas on proper syntax here?
[CODE]<html>
<body>
<?php if (isset($_REQUEST[’email’]))
//if “email” is filled out, send email
{
//send email
$email = $_REQUEST[’email’] ;
$subject = $_REQUEST[‘subject’] ;
$message = $_REQUEST[‘message’] ;
mail(“[email protected]”, $subject,
$message, “From:” . $email);
echo “Your E-mail has been sent”;
}
else
//if “email” is not filled out, display the form
{
echo “<form method=’post’ action=’mailform.php’>
Email: <input name=’email’ type=’text’ /><br />
Subject: <input name=’subject’ type=’text’ /><br />
Message:<br />
<textarea name=’message’ rows=’15’ cols=’40’>
</textarea><br />
<input type=’submit’ />
</form>”;
}
?>
</body>
</html>