Utter newbie & stressing redirect based on form value

the mail() function

Moderators: egami, macek, gesf

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

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";
  case "house":
   $redirect = "house.php";
  case "apartment":
    $redirect = "apartment.php";
    $redirect = "default.php";
} else { 
  $redirect = "cantfindit.php";

header("Location: $redirect");

Post Reply