kirawr 0 Newbie Poster

hellooo. i've been working with this form lately, and i cant seem to figure out how to make the success/error pages redirect to another page. any tips?

///////////////////////////////////////////////////////////////////////
//Don't edit below this point if you aren't sure what you're doing!  //
///////////////////////////////////////////////////////////////////////
  $good = "Thanks for emailing me!";
//above is the sent mail response
  $bad = "Your email has not been sent because you didn't fill out the form properly<br>Press the back button to try again";
//above is the unfilled field response
  $ugly = "Don't access this file directly, go to <a href=\"http://yummyrae.net\" target=\"_blank\">Yummyrae</a> to get this script.";
//above is the anti-access-this-page response
  $oh = "Please use a valid email address";
//above is the invalid email address response

  if ((!$_GET) && (!$_POST)) {
    echo $ugly;
    exit();
//if page has been directly accessed, then show the anti-access
//response and exit the script
  }
  if ((!$name) || (!$email) || (!$message)) {
    echo $bad;
    exit();
//if all fields are empty, then show the unfilled field response and
//exit the script
  }
  if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
  {
    echo $oh;
    exit();
//if the email address doesn't contain @ and . then show the invalid
//email address response and exit the script
  }
$message = stripcslashes($message);

$message = "Name: $name
From: $email
URL: $url
Message: $message

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User Info:
IP: $_SERVER[REMOTE_ADDR]
Browser Info: $_SERVER[HTTP_USER_AGENT]
Referral : $_SERVER[HTTP_REFERER]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
";
//content of the email message you'll get

$from = "From: $name <$email>";

if ($your_email != "")
mail($your_email, $subject, $message, $from);
echo $good;
exit();
//if all fields have been filled in correctly, including YOUR email
//address, then show the sent mail response and exit the script
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.