script/db to setup client access login to restricted directories? HELP!

Joined
Apr 30, 2005
Messages
935
Ok, Ive been searching for a proper way of doing this and i cant find ANYTHING. Ive been looking for 2 days now, talked to some people I know that are database people and they cant figure out how to accomplish this either.
I want to have a section on my site, on the home page with a simple login/password field where a client can enter their credentials and be taken to their 'client staging area' (just a password protected folder on my host, basically)

The issue im having is, i cant find a way to have a form setup so that whatever information they enter IN the form, they will be redirected to their appropriate folder. Ive found scripts for this that ARENT secure and just based on whatever i enter into a txt file somewhere it goes to a directory on my host (would work, but not exactly what i want to accomplish)

I want this form to go to a password protected directory based on what the user enters, and herein is where my problem lies. I dont know (i imagine you are though) that when you try to access a restricted folder on a web site the 'WINDOWS' popup box comes up asking for your login/password (just like how one opens up when you access your router control panel, etc.)

I DONT WANT THIS TO HAPPEN. I dont even know if it IS possible. I dont want to have to give someone a direct link to the pw protected directory either ("go to www.site.com/restricted/client1 and enter user/pass in the window," etc)
Is this making sense?

Ive thought about jump menus, but then people would see the links to the sites and have the potential to tinker with stuff they just arent intended to.
I dont want to have to insert a piece of code on every page, make them all php, or any other individual fix either, this has to be folder restriction only.
Any clues? Similar issues past and solutions? Links to scripts that accomplish this?
Thanks for your help!
 
You could have a simple php/asp login which when it verifies the username\password it takes it to the users 'staging area' so in your database you can have a field called AppFolder and it's value would be www.site.com/restricted/client1 when you extract it and everything has been verified properly you could then redirect them to that.

for example
[Username] [Password] [FolderAccess]
Bobthecoolguy mypass www.site.com/restricted/client1

Then have a simple check to make sure they are logged in.

Can't really help you any further 'cause I don't know what you are writing this script in.
 
Put a php file in between the login form and the protected folder, which grabs the username from the form and redirects them to the correct folder.

html file:

<form action="redir.php" method="post">

php file:

$user = $_POST['user'];

echo 'Welcome $user, redirecting you...';

echo "<meta http-equiv='refresh' content='2; url=/protected/$user'>";

or maybe
$pass = $_POST['pass'];
echo "<meta http-equiv='refresh' content='2; url=http://$user:[email protected]/protected/$user'>";

And secure the folder with an htaccess file.

Wouldn't be very secure though.
 
You can pass the authorization stuff in the http headers. The password has to be Base64 (I think, been a while) encoded. Google for http headers Authorization.

So, take their info from your form
Do your authentication
Then do your redirect to their "home" directory setting the authorization header.

PM me if you need more help, I've got a php script somewhere that almost exactly what your wanting to do.

Sam
 
Back
Top