When you say "this always picks up the first if statement" do you mean the if statement that checks for the session and redirects to the login or the variable = search?
Keep in mind that if you say:
if($variable = "search")
then it will ALWAYS equal search because one = sign means "assignment" while two equals signs == is for comparison. In other words:
$variable = "search" assigns the value of "search" to $variable.
$variable == "search" is a check to see if variable is equal to search, and if so, it returns true, otherwise if it is not equal, it returns false.
so you'll want to say:
if($variable == "search")
But then again, I'm not sure if this is the first "if" statement you're talking about, since technically it's the third.
- Jonathan
Main Topics
Browse All Topics





by: andrivPosted on 2004-02-18 at 11:14:20ID: 10395638
You need to use equal signs in if statements:
($variable == search)
One equal sign is for assigning value and two is to compare.