Welcome Guest, Not a member yet? Register   Sign In
Logic OR using ==
#1

Hi, i want to do this,   only superadmin and admin have access to certain menu.
I use this,,,but it not works , is it something wrong here?

if($this->session->userdata('level') ==  "superadmin" and "admin")
Reply
#2

(This post was last modified: 03-04-2020, 05:05 AM by John_Betong.)

Try adding round brackets because I think $admin is treated as a logical value.
Reply
#3

You want
PHP Code:
if($this->session->userdata('level') == "superadmin" || $this->session->userdata('level') == "admin"
Reply




Theme © iAndrew 2016 - Forum software by © MyBB