Building Menus based on User Rights
| From: | Ray Seals | Date: | Mon, 11 Nov 2002 18:05:00 +0000 |
| Subject: | Building Menus based on User Rights | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-123846@lists.php.net to get a copy of this message | ||
I would like for my pages to generate HTML code based on a users
rights. For example I have a table called user and it looks like this
userid password admin user
--------------------------------------
me mypass Y
you yourpass Y
When a person logs in they are authenticated against this table. Once
they are logged in I would like to build a page with a few links. If
the person has a Y in the admin, I would like to offer an additional
link on the page for some admin functions.
My question is this, when a person logs in I know the user name and
password is stored in the $_POST global. How long does that stay
available. Can I recall the userid and password, query the database and
then generate a page based on those results? Would I be better off
using the session information or setting cookies?
I'm at the crossroads and not sure which trail to start going down.
Ray
--
-------------------------------------------------------------------
Is the Internet down?