RE: elseif with header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux