View previous topic :: View next topic |
Author |
Message |
theblitzrocks -
Joined: 28 Jan 2004 Posts: 9
|
Posted: Wed Jan 04, 2006 2:28 am Post subject: Another way to login to directory? |
|
|
I would like to find a way to login to a password protected directory using a form instead of the ugly login box that comes up... I found a way to do it but it only works on xp systems.. On windows 2000 it comes up as "Page cannot be displayed" after it redirects...
The code I use now takes the username and password from a form, and redirects it to "user:pass@site.com/site" (site being the protected directory):
Code: |
<?php
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
?>
<HTML>
<body bgcolor="black">
<font color=white>
<h3>Please Wait... Logging In...</h3>
<meta http-equiv="refresh" content="2; url=http://
<?php echo "$username:$password"?>
@site.com/site/">
</BODY></HTML>
|
Is there another way to do this so it will work on all operating systems? _________________ EAT EAT EAT, EAT THE MEAT!!!
HOT, SPICY, BURN YOUR GUTS!!!
BURN BURN BURN, HOT HOT HOT!!!
FIRE UP THE BBQ!!!
SENOR PAIN NOW COME FOR YOU!!! |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Jan 04, 2006 3:05 am Post subject: |
|
|
Try this PHP code instead
Code: |
<?php
$username = $_POST["username"];
$password = $_POST["password"];
header("Location: http://$username:$password@www.your-site.com/path");
exit;
?> |
|
|
Back to top |
|
 |
theblitzrocks -
Joined: 28 Jan 2004 Posts: 9
|
Posted: Wed Jan 04, 2006 3:28 am Post subject: thanks |
|
|
thank you very much... _________________ EAT EAT EAT, EAT THE MEAT!!!
HOT, SPICY, BURN YOUR GUTS!!!
BURN BURN BURN, HOT HOT HOT!!!
FIRE UP THE BBQ!!!
SENOR PAIN NOW COME FOR YOU!!! |
|
Back to top |
|
 |
theblitzrocks -
Joined: 28 Jan 2004 Posts: 9
|
Posted: Wed Jan 04, 2006 4:19 am Post subject: another problem |
|
|
it works fine in firefox... not in IE though...
The login box pops up in IE...
Is there another way of doing it without sending the username and password in the URL _________________ EAT EAT EAT, EAT THE MEAT!!!
HOT, SPICY, BURN YOUR GUTS!!!
BURN BURN BURN, HOT HOT HOT!!!
FIRE UP THE BBQ!!!
SENOR PAIN NOW COME FOR YOU!!! |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Wed Jan 04, 2006 4:42 am Post subject: |
|
|
This is a pretty unsafe method to use. If the client is on a wireless network, it's very easy to sniff the username and password. I've done it myself many times in my college. I recommend you using a hash-algorithm, such as MD5 or SHA1. |
|
Back to top |
|
 |
theblitzrocks -
Joined: 28 Jan 2004 Posts: 9
|
Posted: Wed Jan 04, 2006 5:31 am Post subject: ? |
|
|
How do i do that? The directory is password protected... i want to bypass the ugly popup login box... how would i use one of these "MD5" or "SHA1" algorithms? _________________ EAT EAT EAT, EAT THE MEAT!!!
HOT, SPICY, BURN YOUR GUTS!!!
BURN BURN BURN, HOT HOT HOT!!!
FIRE UP THE BBQ!!!
SENOR PAIN NOW COME FOR YOU!!! |
|
Back to top |
|
 |
|