Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: PHP Login Help

  1. #11
    Join Date
    Nov 2005
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    but what if the user and password are different for each page? how would that work with 1 included file?

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    In that case,
    a) you shouldn't be using sessions in the first place, and
    b) you can check $PHP_SELF (possibly) or a global variable set to $PHP_SELF in the documents it's called from.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Nov 2005
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    what would b look like?

  4. #14
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    PHP Code:
    $passstrings = array(
      
    "test.php" => "83580b87d8e1eca38c31949ac85aacfd",
      
    "page.php" => "69630e4574ec6798239b091cda43dca0"
      
    // And so on...
    );
    if(
    $_SESSION['authstring'] == "tst " $passstrings[$PHP_SELF]) {
      
    // Logged in OK.

    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •