|
-
Feb 12th, 2004, 07:53 AM
#1
Thread Starter
Lively Member
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!
-
Feb 12th, 2004, 07:59 AM
#2
Frenzied Member
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)
-
Feb 12th, 2004, 08:03 AM
#3
Thread Starter
Lively Member
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?
-
Feb 12th, 2004, 08:05 AM
#4
Frenzied Member
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.
-
Feb 12th, 2004, 08:12 AM
#5
Thread Starter
Lively Member
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.
-
Feb 12th, 2004, 08:18 AM
#6
Frenzied Member
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.
-
Feb 12th, 2004, 08:27 AM
#7
Thread Starter
Lively Member
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.?
-
Feb 12th, 2004, 07:37 PM
#8
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"); ?>
-
Feb 15th, 2004, 04:49 PM
#9
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|