acctman Posted October 13, 2008 Share Posted October 13, 2008 The statement below works fine when I do if (<%m_country%> != "US") { but when I add the || it doesn't work. if (<%m_country%> != "US" || <%m_country%> != "CA") { echo '<SELECT onChange="HandleStateApearence(this.selectedIndex, null, $(\'state_\'), $(\'state_3\'), $(\'state_2\'), null, 0, 38, false)" name=add[country]>'; global $countries; foreach ($countries as $key => $value) echo "<option value='".$key."'".(<%m_country%> == $key ? ' selected="selected"' : '').">".htmlentities($value['name'],ENT_QUOTES)."</option>\n"; echo '</SELECT>'; echo '<span id=\'state_\' style="DISPLAY:none; font-weight:bold;"> State: </span>'; echo '<SELECT id=state_2 style="DISPLAY:none" name="c_state">'; global $cstates; foreach ($cstates['CA'] as $key => $value) echo "<option value='".$key."'".(<%m_state%> == $key ? ' selected="selected"': '').">".htmlentities($value,ENT_QUOTES)."</option>\n"; echo '</SELECT>'; echo '<SELECT id=state_3 style="DISPLAY:none; name="u_state">'; global $states; foreach ($states['US'] as $key => $value) echo "<option value='".$key."'".(<%m_state%> == $key ? ' selected="selected"': '').">".htmlentities($value,ENT_QUOTES)."</option>\n"; echo '</SELECT>'; } Link to comment https://forums.phpfreaks.com/topic/128143-solved-or-statement-not-working/ Share on other sites More sharing options...
DamienRoche Posted October 13, 2008 Share Posted October 13, 2008 I'm not even sure you should be using the or. So you want to check m_country and if it isn't us or ca, then run the script. Have you tried && operator. <%m_country%> != "US" && <%m_country%> != "CA" Might work..hope that helps. Link to comment https://forums.phpfreaks.com/topic/128143-solved-or-statement-not-working/#findComment-663702 Share on other sites More sharing options...
acctman Posted October 13, 2008 Author Share Posted October 13, 2008 I'm not even sure you should be using the or. So you want to check m_country and if it isn't us or ca, then run the script. Have you tried && operator. <%m_country%> != "US" && <%m_country%> != "CA" Might work..hope that helps. thanks && worked... i was writting the statement work. Link to comment https://forums.phpfreaks.com/topic/128143-solved-or-statement-not-working/#findComment-663720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.