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:[EMAIL PROTECTED]/securedir/');
>
header('http://www.domain.com/securedir/?PHP_AUTH_USER=username&PHP_AUTH_PW=
password');
> header('http://[EMAIL PROTECTED]/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:[EMAIL PROTECTED]/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
====

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to