I'm passing values on a url to a page on my site. So when a user clicks a link different values will pass to the new page depending on which link they click. I'm using a conditional on the second page to vary the code that gets run depending on the value in $_GET.
Unfortunately, for reasons unknown to me the conditionals don't seem to be working properly. In the if statements I'm using || because there are multiple passed values that need to trigger the same code on the second page (they need to be named differently because they also all trigger unique code).
It seems rather simple, I start with:
if($_GET['id']=('x' || 'y' || 'z')) {
block of code
}elseif($_GET['id']=('a' || 'b' || 'c')) {
block of code
}else{
block of code
}
I have printed out the values of the $_GET['id'] to check that the correct value is being passed from the first page to the second based on the link clicked. This is working properly. Every link I click prints the expected value. The odd thing is I echo'd these values both within the first conditional and above it. It printed in both cases, even when it printed a value that shouldn't have triggered that conditional. Any ideas?