TRI0N Posted May 13, 2007 Share Posted May 13, 2007 Here is what I want to do. I have a password protected directory that has several users logins. Now what I want is to be able to detect what user is logged in with lets just say a simple "Hello <?php echo $username ; ?>!" though that is not the real purpose of my need since it's more on the need for tracking was users do. But the above example will answer all that I need to do to create. Also is it possible to create a user control panel that will allow them to change your passwrod once logged in? Thanks for any help on getting this into a working idea. Cheers! TRI0N Quote Link to comment Share on other sites More sharing options...
trq Posted May 13, 2007 Share Posted May 13, 2007 Now what I want is to be able to detect what user is logged in How are you logging these users in? Or is that your actual question? Quote Link to comment Share on other sites More sharing options...
TRI0N Posted May 13, 2007 Author Share Posted May 13, 2007 Now what I want is to be able to detect what user is logged in How are you logging these users in? Or is that your actual question? They will be logging in via the Password Protect Features of HTTP using htpasswd and htaccess under SSL. So once a user logs in I want to know who that user is. Example. John Doe logs in and is in the admin area.. He adds a record to an existing database. I want to know that John Doe was the one that added the addition to the database. Now I could use session logins but would like to use this approach. Would like to know the user name of the person that logged in. So in a easy example to give me would be how would I make it see the user and on the page beyond the login pop-up say "Greetings John Doe!". How do I find out what the username that was given to make that happen? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted May 13, 2007 Share Posted May 13, 2007 ok, wel firstly, id actually code it, and wouldnt rely on the server, becauae it doesnt record theusername etc from memory. what id do is: login and create the session or whatever. then what i do is have another table, with all page requests. then there is a include file at the begining of every page: include("check_login.php"); include("log_page.php"); also in the login section, i have a login tbale, with ID, in and out, and user etc. so in oage logging, you can simply add that persons UserName, User_ID, IP, Login id, so you can tell which session.... all of this. and only with a few require and tbales in a database. if you ned more info on how to do this, contact me through my email from my profile. good luck. Quote Link to comment Share on other sites More sharing options...
TRI0N Posted May 13, 2007 Author Share Posted May 13, 2007 Yes I know about sessions and such usint PHP with MySQL to store that type of thing.. However this is a Intranet Based backend where Internet will not be used and those that will be using it are Managers of the corporation that who will be approving things and. The idea to track who changed a record would be more a need for me as admin not for the managers since I will be using such as a trouble shooting need. But if I cannot obtain the usernames from using a simple Dir Protection and grabbing the name used rather then writing a whole session routine that really isn't need.. However it seems that that will be my only choice at this point.. Thanks. TRI0N Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.