/    Sign up×
Community /Pin to ProfileBookmark

php or condition

I have the below code, that seems to fail, but I’m not sure why. If I echo our the $check[“team”] variable, I get “Group 1”, but my page still says I don’t have priveleges.

[code]
if (($check[“team”] != “Group 1”) || ($check[“team”] != “Flower Delivery”))
{
// Feel free to change the error message below. Just make sure you put a “” before
// any double quote.
print “<p><strong>Illegal Access</strong></p>”;
print “<p><strong>You do not have permission to view this page.</strong></p>”;

//exit; // End program execution. This will disable continuation of processing the rest of the page.
}
[/code]

What I want is that if you are not a member of “Group 1” or “Flower Deliver”, don’t show the page.
Thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@scragarJan 07.2008 — change || to &&

basicly your saying if it's not "Group 1" or it's not "Flower Delivery". since it cannot be both of these your always going to get it throwing you to the message.
Copy linkTweet thisAlerts:
@jrthor2authorJan 07.2008 — Thanks
×

Success!

Help @jrthor2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...