User Level Access.......

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
G2F
Beginner
Beginner
Posts: 1
Joined: Tue Apr 22, 2003 9:01 pm

User Level Access.......

Post by G2F »

I have a php website and i was wondering if it is possible to to create a menu that displays different links depending what user level you have.

I.E. Admin, Registered User, Non-Registered user.

If so please can someone tell me how i would do this.

Tnx in advance,

G2F

P.S. Please can you put it in dumbass terms as I am not very good at coding. :roll: Tnx Again.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

The good news: It is possible. Two general options: (1) Generate the menus dynamically, using server-side scripting, like php. (2) Store the current user's access level locally -- e.g., in a variable within a hidden frame, in a cookie (bad if cookies are diabled), or in a parameter passed from page to page -- and use conditional tests in the menu_array.js code to generate the different menu versions at runtime.

The bad news: Either approach will require a good working knowledge of the scripting language (php or js), so you may find it a bit difficult if you're a beginning scripter.

Kevin
jvaska
Advanced
Advanced
Posts: 11
Joined: Sat Jul 05, 2003 7:14 pm

Post by jvaska »

no, it can be easier than that...

set user levels in the user info table...0,1,2...

set the user levels in the menu and/or page settings in the db (create extra fields for these)...

then, when you are looping out your data just call up an if statement...something like...

if $row_user['user234']' >= $row_menu['menu1'] then ... loop out your info...

if user is level 0 and the data is level 1...they don't get it...if they are level 1 or 2 or more though...yep, they can have it...

this is what i've done for something small...it's not sessions or cookies, but it does the trick...you can also restrict the various functions they have access to - like maybe a delete button or whatever...

good luck...jv

(i'm assuming you have some kind of login thing going on there)
Post Reply