Login Screen

I wan to use .htaccess to protect the directory but I don't link the pop-up login window.
Is any way I can use my login screen and still login to the protect directory?

thanks
jpchenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

monasCommented:
I don't know about IE, but Netscape allows you to access http://login:password@www.example.com/path/to/page.html

but this URL will get to your Location bar, which is probably not what you want.

Possible solution:
1) make login screen you want;
2) get your login/password via your script; check if they are correct (you can not realy on www server for this)
3) generate page stating "you are allowed to get in" with <img src="http://login:password@your.site.com/protected/dir/img.jpg">

when user's browser will download image - browser will be told what login/password pair is for this are, so when it will access your documents from this area it will reuse password already known.

Drawbacks:
1) your user still will be asked for password if he'll follow link _BEFORE_ image will be received;
2) there will be user's logins/passwords in server log 'cos for images browsers uses GET method.
0
jpchenAuthor Commented:
Look like that there is no other solution?
0
joemacdCommented:
Hi,

I haven't used a Netscape server for a year or so, but perhaps you'd like to try a variation of a previous answer from above.

When you get the login/password from your login screen, have your script read them and then:
..
..
$URL= "http://" . $login . ":" . $password . "@www.site.com/page1.html";
 
print "Location: $URL\n\n";


This should immediately send the user to page1.html without the popup by creating the following URL:
http://login:password@www.site.com/page1.html 

If you don't like having the login/password in the URL, you can use a backdoor and have page1 be a script that immediately sends them to:

print "Location: http://www.site.com/page2.html";

They should now end up on page2.html (the destination) without having the popup box or a messy location bar.

Drawbacks:
1) The intermediate page (page1.html) still contains the messy URL with the login info, and if they hit "Back" they'll end up on page2 again.
2) The log files still have the login info.

Other than that, I think you're stuck with the popup box.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jpchenAuthor Commented:
Hi,
  Look like is no other way right now.
Thanks for help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.