Jump to content

Please help with Session [level]


mascotoc

Recommended Posts

Hello Guys,

My programmer left suddenly and I need help urgently as i am not a programmer.
I am using a simple logincheck.php file and I want to grant access to User level with '2' and '5'
my current following script is working perfectly if the user level is '2'. BUT how do i add '5'

i.e. I want to give access to user whos level is either 2 or 5 rest all levels will be denied.

[code]<?php

session_start();
if(!isset($HTTP_SESSION_VARS['level'])){
  header("Location: http://www.website.com/login/error.php");
} else {
  if($HTTP_SESSION_VARS['level'] != 2){
    header("Location: http://www.website.com/login/error.php");

  }
}
?>[/code]
This code works perfectly... but how do i add
($HTTP_SESSION_VARS['level'] != 5)

I tried using AND & OR .. but its giving error.

I want something like

[code]
if($HTTP_SESSION_VARS['level'] != 2) OR if($HTTP_SESSION_VARS['level'] != 5)
[/code]
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.