Jump to content

PHP & Password Protected Dirs


TRI0N

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.