php redirect
Posted: Wed Jun 23, 2010 4:25 pm
Hi. I have a form in html, and when submit is hit, it uses my php code to send an email. If the email sent is successful, I want it to display a new html file, likewise for a failure. You should be able to see what I am trying to do from this
Is something like this possible?
cheers
Code: Select all
<?php
session_start();
if(isset($_POST['Submit'])) {
$to = $_POST['receiver'];
$subject = "Has sent you an E-Card";
$sender = urlencode($_SESSION['sender']);
$body = "Hi";
mail($to, $subject, $body);
header("Location: PageA.html");
exit();
} else {
header("Location1: PageB.html");
exit();
}
?>cheers