How to check who is logged in from .htpasswd protected folder?

Discussion in 'PHP' started by anilinkz, Oct 31, 2010.

  1. #1
    How to check who is logged in from .htpasswd protected folder?


    so i can do something like

    if ($loggedin) {
    // do this command
    }

    and also checks who is logged in
     
    anilinkz, Oct 31, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    Its a little bit more complicated then that, here's a link to help you on your way. If your still stuck by all means post up your code and let us know what you have done so far etc..
     
    MyVodaFone, Oct 31, 2010 IP
  3. leh

    leh Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's actually quite simple.. the variable $_SERVER['PHP_AUTH_USER'] will contain the authenticated user.
     
    leh, Nov 1, 2010 IP