I am purplexed.
Made a form that checks for errors, submits info to email, then redirects the user to a new page.
The user presses one of three buttons to submit the form. Depending on which button is chosen the user is redirected to the appropriate page.
To do this I used , header ("Location: using "elseif" conditions.
Everything works ok. But if I type in a new <p> in the text above the redirect no longer works.
Here is that bit of code that follows some text:
if ($submit || $submit2 || $submit3) { // if any of the submit buttons are pressed.
$stop = false;
if($fname == ""){//check first name
print("Your first name is required.<br>");
$stop = true;
}
if($lname == ""){//check last name
print("Your last name is required.<br>");
$stop = true;
}
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) ){//check email
print("The e-mail address is invalid.<br>");
$stop = true;
}
if($addy1 == ""){//check addy1
print("Your address is required.<br>");
$stop = true;
}
if($city == ""){//check city
print("Your city is required.<br>");
$stop = true;
}
if($state == "" || $state == "Select a state" ){//check state
print("Please select a state or province.<br>");
$stop = true;
}
if($zip == ""){//check city
print("Your zip/postal code is required.<br>");
$stop = true;
}
if($country == ""){//check country
print("Please select a country.<br>");
$stop = true;
}
if($hear == "" || $hear == "Select One"){//check country
print("Please select how you heard .<br>");
$stop = true;
}
if(!$stop){ //if ok then mail
mail("$youremailaddress","$subject","$body","From: $name <$email>") or die("email error");
//tells where to go based on the button they pressed
if($submit){
header ("Location: [url]http://www.blank.com/trial_mac.php[/url]"); //send to the page for download for mac.
}elseif($submit2){
header ("Location: [url]http://www.blank.com/_win.php[/url]"); //send to the page for download for windows.
}elseif($submit3){
header ("Location: [url]http://www.blank.com/trial_macosx.php[/url]"); //send to the page for download for Mac OS X.
}
}
}//End if submit statement.yo
?>
Any advise would help thanks..