RE: [PHP-DB] elseif with header
| From: | Bruno Pereira | Date: | Tue, 21 Jan 2003 09:45:39 +0000 |
| Subject: | RE: [PHP-DB] elseif with header | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24998@lists.php.net to get a copy of this message | ||
I Larry is correct you havo to use (==) not (=).
The first one is comparing two variables and the second is that var is equal
to another var.
Cumprimentos
Bruno Pereira
bruno.pereira@netvoice.pt
-----Original Message-----
From: Larry E. Ullman [mailto:LarryUllman@DMCInsights.Com]
Sent: terca-feira, 21 de Janeiro de 2003 0:29
To: Addison Ellis
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] elseif with header
> 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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php