|
-
Nov 18th, 2002, 09:10 PM
#1
Thread Starter
Lively Member
Redirecting not working in php.
I'm trying to get this stupid php to redirect after it send mail. Heres the php code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Survey Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head><body bgcolor="#EBECED">
<p><b><big>
<?php
function ValidateMail($Email) {
global $HTTP_HOST;
$result = array();
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) {
$result[0]=false;
$result[1]="The email address entered is not properly formatted. Please press the back button and correct your email address!";
return $result[1];
} else if ($Email == "[email protected]") {
$result[1]="Please enter an e-mail address! Press your back button to make this correction.";
return $result[1];
}
else
$result[0]=true;
$result[1]="$Email appears to be valid.";
return $result[0]; } // end of function
$Returned = ValidateMail($Email);
if ($Returned == 1 ) {
print ("Processing your request...");
mail("[email protected]", $Subject, "Name: $Name \n\n $Message", "From: $Email");
header("Location: http://www.example.com/");
exit;
}
else
print ($Returned);
?>
</b>
</big>
</p>
</body>
</html>
It doesn't want to redirect to the address....whats wrong here?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|