SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htpasswd Authentication & User Tracking

    I'm using .htaccess & .htpasswd for User logins

    Is there a way to get the username for each page request so I can do some user tracking via php?

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $_SERVER['AUTH_USER'], or sometimes it exists as $_SERVER['PHP_AUTH_USER']. I think whichever exists for you is dependent upon your version of PHP, but I can't tell you which exists for which version(s).
    PHP questions? RTFM
    MySQL questions? RTFM

  3. #3
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess it helps if you use the right one. So for anyone doing this, always create a global variable at the begining of the script that defins which of these variables you're version uses. So you don't have to go through every page and change them all everytime you switch over to another version of 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
  •