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

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")

(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.

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

Theme © iAndrew 2016 - Forum software by © MyBB