Re: elseif with header

From: Date: Tue, 21 Jan 2003 00:29:11 +0000
Subject: Re: elseif with header
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24991@lists.php.net to get a copy of this message
if ($category = 2 and $subcategory = 52) { header("Location: http://www.vanderbilt.edu/register/ca/vacation_rentals.php"); } elseif ($category = 2 and $subcategory = 50) { header("Location: http://www.vanderbilt.edu/register/ca/rentals.php");
}      , etc.
for some reason all the elseifs are going to the if header. any input as to how i can correct this is greatly appreciated.
You are using the assignment operator (=) instead of the equals comparison operator (==) which makes your if condition always true. Larry

« previous php.db (#24991) next »