tried removing the error reporting and it gives me: Notice: Undefined variable: pdo in C:\wamp\www\simpleblog\admin\menu.php on line 11..also this one: Fatal error: Call to a member function query() on a non-object in C:\wamp\www\simpleblog\admin\menu.php on line 11

Replace $pdo with $db

now it returns "1".....nice...now to figure out how to return the roleid of the logged in user...i logged in as a user whose roleid=2....so, i noticed it returned 1..meaning i just need to change some things...I'll try it fist before asking you..thanks so much..

Member Avatar for iamthwee

Trying to run before you can walk... Need we say more.

Hmmm, that explains why.
First of all, how are you supposed to get that $_SESSION['roleID']??
Is it through a login script??

no worries thanks for all your help....i was able to understand and apply all of your comments/concepts to my website especially to mr.Pritaeas..now the website is able to restrict pages for different kind of users(admin, faculty or student)...:3

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.