SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    user authorization

    Hehe..last one. i promise. Thanks to freakysid i was able to make a nice little authorization script that uses mysql like vB. so i have one more question about it. which kind of code would i have to put inside global.php in order for it to ask for authorization everywhere it's required. so if i have a file called index.php and in it i have
    PHP Code:
    <?
    require("./global.php");
    echo 
    "Stuff over here"
    ?>
    in this file since it required global.php i wish for it to ask me for authorization before allowing the text "Stuff over here" to be seen. how would i go about doing this. i already have the form that will verify the users username and password thorugh mysql.

  2. #2
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just put in however you want to validate the users, if they are not validated put:

    exit;

    And this will 'exit' the script, and will stop running everything from there.

    Before the exit; put the stuff you want to print so that they can then login.

    So it is kinda like this:

    if (they aren't logged in) {
    give them form to log in
    exit;
    }

    and cos that won't be true if they have logged in, then it will carry on with the rest of the script that global.php is required/included in

    Hope this helps

  3. #3
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok so if i put this inside global.php at the very bottom. and in temps.php i add

    require("./global.php"); at the top it will ask for the authorizaion? i'm at school right now so i can't really trybut hypethetically speaking.


Bookmarks

Posting Permissions

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