Jump to content

problem with if statement


psychohagis

Recommended Posts

I have the following if statement:

 

if ($_SESSION['rank']!='webmaster' OR $_SESSION['rank']!='chairman' OR $_SESSION['rank']!='secretary' OR $_SESSION['rank']!='treasurer')
{
exit('<meta http-equiv=refresh content=0;URL=http://www.MYSITE.org.uk/events.php>');
}

 

I dumped the variable $_SESSION['rank'] and it came out as "webmaster" but I still get redirected away?

 

Can anyone help?

Link to comment
Share on other sites

events.php is for authorized users, or unauthorized? If it's for authorized, then you need to keep the OR, but it seemed to me it's for unauthorized users.

Now, for the session_start() part, you need to use that because if you don't use it the $_SESSION array is not restored. Every time you want to use the $_SESSION array, make sure you call session_start().

 

Orio.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.