problem redirecting to protected directory
From: Bart (phplist_at_easyaddin.nl)
Date: 12/03/03
- Next message: Lowell Allen: "Re: [PHP] Session Expiration Problem...."
- Previous message: Jay Blanchard: "RE: [PHP] register_globals problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "Php-General" <php-general@lists.php.net> Date: Wed, 3 Dec 2003 21:23:29 +0100
Hello,
Can you people help me with the following authentication-problem?
I have a directory names 'secure' that contains only html-files. Access is
only allowed for
registered website-visitors. Within the directory it isn't possible to place
php-files for
access-control so I have passwd-protected this directory with one 'username'
and 'password'.
Above this 'secure'-dir I've placed a login-form that checks a MySQL-db for
the entered login.
When a correct login is entered the visitor has to be able to access the
'secure'-dir without
knowing/seeing the 'username' and 'password' that protects the dir.
How can I redirect the visitor to this 'secure'-dir without showing the
login-popup?
I've tried to use the header-function several ways, but the popup keeps
popping!!
> header('http://username:password@www.domain.com/securedir/');
>
header('http://www.domain.com/securedir/?PHP_AUTH_USER=username&PHP_AUTH_PW=
password');
> header('http://username@www.domain.com/securedir/:password');
Strange thing is that when I use the JavaScript below the redirect works and
no popup is shown.
The only problem with JavaScript is that when it is disabled in the visitors
browser the script
isn't executed and the full url is visible when viewing the source of the
page!
>> start..JavaScript <<
window.location="http://username:password@www.domain.com/securedir/";
>> end....JavaScript <<
How can I redirect a logged in user to the 'secure'-dir and also pass the
'username' and
'password' that give access to this dir?
I hope you can help me out with this...
Thanks in advance.
Best regards,
Bart
====
- Next message: Lowell Allen: "Re: [PHP] Session Expiration Problem...."
- Previous message: Jay Blanchard: "RE: [PHP] register_globals problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|