php - redirection to another page if array does not match -


have built login system, can assign permissions user lets them access page or not, works fine. if user logged in , has permission shows content , if not logged in redirects login page.

i trying add redirect in if logged in no have permission takes page has information on product.

i have set :

 <?php   if (!securepage($_server['php_self'])){die();}  $parts = parse_url($_server["request_uri"]);  $page_name = basename($parts['path']);    //links logged in user     if(isuserloggedin()) {           //links permission level 3 (bof)          if ($loggedinuser->checkpermission(array(3))){      *do something*      (more code)      <div id='default'>     <?php } else { ?>     *login* 

i know going through , "if permission not this" have on 20 permissions , climbing. trying like:

    if ($loggedinuser <> 3){         header( 'location: http://www.yoursite.com/new_page.html' ) ;         } 

however parses displays no result, i'm guessing variable being empty?

any ideas on best workout please?

it seems mixed objects , variables.

judging

($loggedinuser->checkpermission(array(3)))

$loggedinuser should object.

but try compare object integer. may be, forgot method? smth like

if($loggedinuser->id!=3)

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -