Results 1 to 9 of 9

Thread: Track a user?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125

    Track a user?

    I have a protected portion of a web page. Is there a way I can track who logs in and what time?

    Thanks!

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    What are you using to log them in? I'd imagine some kind of database, correct? Why can't you store the time/name in there? And if you want to keep a record, simply keep running records of everyone that logs in. (I'd think you'd want to set a limit on the # of records tho)
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125
    I am using the 'password protect Directory' feature of my website. I protected a folder and people log in when going to that folder. I was wondering if there was a way to capture which user was logged in?

  4. #4
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    I don't believe you're going to be able to track them using that method. You're almost certainly going to need to setup a database that can hold times/usernames and you'll have to use a PHP algorithm to log them in.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125

    Thanks

    Thanks. I didnt know if I could just get who was logged in and then I can write that to a database. I didnt know if the username could be passed or not.

    Thanks for the help.

  6. #6
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    With a protected directory, all you have is an access file containing usernames and passwords. When someone tries to login, it checks that htaccess file. I can't personally think of a way of trapping that login without having some program resident on the server, because it's not like you're logging in through a page. You get a pop-up to enter your information. AFAIK, all that is handled through the server.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125

    hmmmmm

    The username and date is stored in the raw access log, correct? If so, does anyone recommend a program that analyzes access log information.?

  8. #8
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    I know that Perl can view which user is logged in through an HTACCESS login.. Perl uses $ENV['CURRENT_USER'].

    I suggest you try making a test PHP file that looks for the CURRENT_USER enviroment variable.. kinda like this:

    PHP Code:
    <? echo getenv("CURRENT_ENV"); ?>
    Like Archer? Check out some Sterling Archer quotes.

  9. #9
    Addicted Member Phenix's Avatar
    Join Date
    Sep 2002
    Location
    Near A Cube
    Posts
    228

    Thumbs up

    For a user authenticating through Htaccess (i.e. whenyou say 'protected portion of a web page') and hitting a PHP page, use $_SERVER['PHP_AUTH_USER'] or $HTTP_SERVER_VARS['PHP_AUTH_USER'].

    For the date and time, if you store the time in a database, say MySql, you can use "NOW ()" in your SQL statement. Or from PHP, use the "date()" function. For the same format as NOW() 'YYYY-MM-DD HH:MM:SS' in MySql, use date("Y-m-d H:i:s").
    Circa 1995
    Engineer - I think we should put our website address on our paper catalogs.
    Vice President - Don't get too excited about this internet thing.


    I am sorry, but the Oracle was mistaken. You cannot help us.
    -Matrix video game


    I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. ... and it probably never will support anything other than AT-harddisks, as that's all I have :-(.
    -Linus


    Question. Do you know that the character "?" means I'm asking a question? Question. Do you know that spoken inflection also provides the same cue? So please don't say, "Question" before you ask your question. Believe me I'll know.

    That said, I would have said this first if it had to precede what I'm telling you now. Having said that, what I'm telling you now is the same thing I just said about the annoying phrases "That said" and "Having said that".


    Are you threatening me, Master Jedi?
    -Chancellor Palpatine

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