login for clients

Levi

Moderator
Staff member
Does anyone know of a tutorial or similar to make a link which when clicked asks for their login details and then goes off to their page rather than a single page for all of the users.

ie
login - username/password a - to folder a homepage
login - username/password b - to folder b homepage

I can set up passworded folders easy enough I'm just not sure how to link to these using a single login.

As a side note:
Currently I'm going to just make html pages for the files in each folder and then add to it as new files are added, are there any other options, maybe including storing last download date/time and ip?
 
Heres a basic 1 I wrote http://www.designforums.co.uk/web-coding-development/4221-ip-restriction-blocking.html#post51610

You would just need to add seperate lines for example ~
if($_POST['animal']=="thisisyourusernamechangeittowhateveryouwant" || $_POST['pass']=="thisisyourusernamechangeittowhateveryouwant"){
session_start();
$_SESSION['cat']="Do you know this cat is in fact a monkey?";
$_SESSION['dir']="dir1";
header('Location: http://example/dir1/');
}}elseif($_POST['animal']=="thisisyourusernamechangeittowhateveryouwant" || $_POST['pass']=="thisisyourusernamechangeittowhateveryouwant"){
session_start();
$_SESSION['cat']="Do you know this cat is in fact a monkey?";
$_SESSION['dir']="dir2";
header('Location: http://example/dir2/');
}

Then also test for the correct directory and log them out if they try to access the wrong one of load their default page.

If this is to go onto a live site the user name and password should be entered into a DB and more security applied. If it is needed for a live site let me know and I'll help you implement it.

If you need help writing it or understanding it better let me know.

Jaz
 
I'm seeing how easy this is compared with a collab option (softalicious installer) for my my new site (eventually), I'm edging this way as it's more likely I'd use it than the collab bits.

Give me a day or two to digest the link etc as I've got a cracker of a headache at the moment and nothing will sink in :(
 
Bit early for drinkepoos isn't it fella. :D
No worries just let me know if you would like it more secure and any more features when you have. :)
 
I'm teetotal so it's not that, I've just got a cracker for some reason, thinking it may be lack of fluids as I've not been drinking as much as usual.

Can you clear out your inbox, I need to send you a pm to get the correct link, your motherboard isn't a game (might be the issue :p)
 
Back
Top