#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    I have setup an authentication system using php3 and mySQL, authentication is done using $php_auth_user, firstly a check is done to see if the user has been validated if not the user is prompted for user and pass....

    The information is compared using an sql query, and then the user is allowed/denied access.

    I would like to pull some of the users details out of the DB with the query and have them avalible to any php script without having to use cookies.

    currently the authentiction script is included in all the pages, what i would like to do is have 4 levels of access and use a simple if access_level = 001.... then the associated page with those access priviliges is loaded.

    the problem im having is that after the fist page loaded, if the user loads the second page the authentication is checked and since the user is allready authenticated the query is not done, at this stage the viariable containing the users access privilges is blank and i would need to re-query the database just to get the info..

    Any way around this?

    Regards
    Andrew
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Aalborg, Denmark
    Posts
    36
    Rep Power
    15
    Hi

    There is a way around the problem:
    If you have access to php 4.0 you can use it's build in session management. Alternatively you can use phplib if you stay in the php3 environment (http://phplib.netuse.de/).

    Check the articles on session management here on devshed.com

    Once you've learned it you can't imagine how you ever lived without it

    // Martin

Similar Threads

  1. global variables + oscommerce
    By gbow in forum PHP Development
    Replies: 2
    Last Post: February 12th, 2004, 03:08 AM
  2. How do you usually define constants with a package?
    By jerry_meng in forum Java Help
    Replies: 2
    Last Post: January 6th, 2004, 12:54 PM
  3. define()ing constants vs global variables
    By jharnois in forum PHP Development
    Replies: 2
    Last Post: February 26th, 2003, 03:15 PM
  4. Function programming global var problem
    By beardo in forum PHP Development
    Replies: 3
    Last Post: February 19th, 2003, 04:03 AM
  5. since nobody answers me, got a new quesition.
    By seanma in forum MySQL Help
    Replies: 7
    Last Post: August 26th, 2000, 11:47 AM

IMN logo majestic logo threadwatch logo seochat tools logo