Results 1 to 3 of 3

Thread: Login!!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Login!!

    I've asked this before and am needing help on one last page!!

    I have a members signup page where they sign up and have a user level of 0. I have to have a page which I can inlude on any page which will confirm they have logged in and if not kick them out of the login page and if they have then confirm if they are a user or admin... if a admin page then say you don't have the permissions!!

    I have a sign up page done just want a auth.php page to do the above

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    So what's your question?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I'm just going to assume you don't know how to do it and you are asking for direction...

    This is psuedocode (more like plain english), but it'd go something like this:

    Code:
    auth.php
    
    Connect to the Database
    
    if cookies are set {
        Query the database to validate cookie data
        if cookie data is valid {
            Store the username and permissions in a variable
        } else {
            clear the invalid cookies
            take them to a login page
        }
    } else {
        take them to a login page
    }
    Include this page at the top of every page.

    In the admin page, query the permissions variable you created (say $CONFIG['permission']). If the value is 0, tell them they don't have permission to view the page. If it's 1 (or whatever you're going to have it as), show them the page.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width