I am working on a new program that sends info from an html pageform and goes to a php form for verfication and redirecting. My problem is I cannot figure out what php command to use for the redirect. I also would like it to go to a relative url. Here is an example of what I was considering but I doubt very seriously if this will work. gettype($parent); if(empty($parent)) { die("No Choice Selected"); } elseif $parent="boyboth" ( header("Status: 200"); header("Location: somesite.com"); Exit(); ) elseif $parent="boyfather" ( header("Status: 200"); header("Location: http://somesite.com"); Exit(); ) elseif $parent="boymother" ( header("Status: 200"); header("Location: http://somesite.com"); Exit(); ) elseif $parent="girlboth" ( header("Status: 200"); header("Location: http://somesite.com"); Exit(); ) elseif $parent="girlfather" ( header("Status: 200"); header("Location: http://somesite.com"); Exit(); ) elseif $parent="girlmother" ( header("Status: 200"); header("Location: http://somesite.com"); Exit(); ) else exit; ?> Code (markup):
Hi! header ("Location: url"); shoud work fine, if you don't output anything else before it on your verification page! You're bit wrong with your IF structure: wrong: elseif $parent="boyboth" correct: elseif ($parent == "boyboth") == instead of =
I like to print "<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"></HEAD>" in the header 0 being the time to refresh.
Thanks for the tip. Can I use somesite.php though as a relative url or am I going to have to use the entire url address for each one?
If the somesite.php file is in the same directory where is your verfication script file, then you can easily use as link just somesite.php filename!