Link to home
Start Free TrialLog in
Avatar of rustyrpage
rustyrpage

asked on

Re-direct users after email script

I have a PHP mail script (see below) that is working great.  However, at this time, when someone hits SEND on the HTML page, it just directs them to a blank white page, so they keep hitting back & send again.

What would it take in this PHP script to re-direct it to thankyou.html once they have submitted the form?

Thanks!
<?php
 
// Report PHP errors
error_reporting(E_ALL);
 
// Assign the variables
$requester = $_POST['requester'];
$phone = $_POST['phone'];
//$date = date(F j, Y);
$bdesc = $_POST['bdesc'];
$desc = $_POST['desc'];
$loc = $_POST['loc'];
$cdate = $_POST['cdate'];
$dept = $_POST['dept'];
$email = $_POST['email'];
 
// Mail
$static = "rusty.page@bioness.com";
$subject = $bdesc;
$body = "<strong>"."Requester's Name:     " ."</strong>". $requester . "<br>" . "<strong>". "Requester's Phone Number:     " ."</strong>". $phone . "<br>" ."<strong>"."Problem Description:     " ."</strong>". $desc . "<br>" . "<strong>"."Location:     " ."</strong>".$loc . "<br>" ."<strong>"."Date needed by:     "."</strong>" . $cdate . "<br>" ."<strong>". "Requester's Department:     " ."</strong>". $dept;
$headers = 
      "From: " . $email . "\r\n" . 
      "Reply-To: " . $email . "\r\n" . 
      "MIME-Version: 1.0" . "\r\n" . 
      "Content-type: text/html;charset=iso-8859-1" . "\r\n" .
      "X-Mailer: PHP/" . phpversion();
mail($static, $subject, $body, $headers);
 
 
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of EMB01
EMB01
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rustyrpage
rustyrpage

ASKER

Do I put that at the very end of the script? (after the mail line)
Note: Just add it to the end of the script.
Yeah, let me know if you need any more help.
Pure genius!

Thanks again - you were so much help!
Hey, it's you putting it all together! By the way, let me know if you want to add validation. It's a little more tricky but we can do it. Have a great afternoon!