vrmetro
asked on
elseif ($_SESSION['country'] == 'br') need multiple values where br is
Is it possible to have multiple values where I have my "br"?
elseif ($_SESSION['country'] == 'br'){
tried: elseif ($_SESSION['country'] == 'br,mx,nl')
But doesn't work. Thank you
elseif ($_SESSION['country'] == 'br'){
tried: elseif ($_SESSION['country'] == 'br,mx,nl')
But doesn't work. Thank you
ASKER
tried it and did not work, thanks though.
ASKER
a little more clarification,
these are outputing information submitted on a previous form with the values stored in the session; see code below, I would like to not have 3 different elseif echos and use the same elseif for de, fr, and nl which are the values of three different countries submitted on the previous form, only one will be stored in the session.
these are outputing information submitted on a previous form with the values stored in the session; see code below, I would like to not have 3 different elseif echos and use the same elseif for de, fr, and nl which are the values of three different countries submitted on the previous form, only one will be stored in the session.
elseif ($_SESSION['country'] == 'de'){
echo
"You'll need a phone with GPS on a GSM Network<br />
<div id=\"plans\">
<div class=\"plan_left\">
<p class=\"notice\">
<input type=\"checkbox\" name=\"plan\" id=\"plan\" value=\"12.95_eu\" /><img src=\"images/spacer.gif\" width=\"15\" height=\"1\">
Unlimited €12.95/month<br />
<img src=\"images/spacer.gif\" width=\"1\" height=\"10\"><br />
<span class=\"sm-text\">Use as much as you'd like - This plan includes<br />
Location History: See current location and history<br />
Speeding Alerts: Customize</span><br />
</p>
</div>
<div class=\"plan_right\">
<img src=\"images/blackberry_w_target.jpg\" width=\"111\" border=\"0\" />
</div>
</div>
<br />";
} //end div
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This line works:
elseif ($_SESSION['country'] == 'DE'||$_SESSION['country'] == 'NL'){
echo //somecode
}
This one does too, but still only for DE and NL, FR does not work for some reason:
elseif ($_SESSION['country'] == 'DE'||$_SESSION['country'] == 'NL'||$_SESSION['country'] == 'FR'){
echo //somecode
}
elseif ($_SESSION['country'] == 'DE'||$_SESSION['country']
echo //somecode
}
This one does too, but still only for DE and NL, FR does not work for some reason:
elseif ($_SESSION['country'] == 'DE'||$_SESSION['country']
echo //somecode
}
ASKER
Scratch that, it does work. Was access in wrong test space. Thank you for your help though, if there is a cleaner way to do this using in_array I'd very much like to know how. If not, I'll wait a few hours and assign points for your help. thank you!
ASKER
I'd like to find out how to use the in_array command to accomplish the same goal if possible. thanks.
elseif(in_array($_SESSION[