Utter newbie & stressing redirect based on form value

the mail() function

Moderators: macek, egami, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Utter newbie & stressing redirect based on form value

Post by egami » Fri Dec 23, 2011 7:52 am

Are you sure that $Type1 is an array?


it would seem to me that it's just a variable, so you're IF statement is off.

You would need to re-write it to something like..

Code: Select all

if (isset($Type1)) { 
 switch (strtolower($Type1)) { 
  case "farm":
   $redirect = "farm.php";
   break;
  case "house":
   $redirect = "house.php";
   break;
  case "apartment":
    $redirect = "apartment.php";
    break;
  default:
    $redirect = "default.php";
    break;
  }
} else { 
  $redirect = "cantfindit.php";
}

header("Location: $redirect");
 

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests