View Full Version : login and password window

07-16-2003, 11:09 AM
someone knows how to generate that small window that apears when you go into a member area of a secure place that ask you for a login and password, like window does.

07-16-2003, 12:43 PM
Its all to do with .htaccess and htpassword files.

I am not 100% sure on the how's and when tos etc but I am sure someone can elaborate.

07-24-2003, 01:41 AM
If you use a password script, you would have to use javascript to have a password window pop up, then have the form in the pop up load send the information back to the main window and close itself.


08-06-2003, 01:42 AM
You may also try using ASP and there is a way (though I never have tried it) to get similar security and access as using Windows NT

08-06-2003, 01:53 AM
You can use HTTP headers to make that dialog come up:

WWW-Authenticate: Basic realm="Place To Access"

You can do it like this with PHP:

// user/pass not given yet
if(!isset $_SERVER['PHP_AUTH_USER'])
// if user submits info, page is re-requested with vars set,
// if user hits cancel then code after first header() is displayed
header('WWW-Authenticate: Basic realm="Place to access"');
header('HTTP/1.0 401 Unauthorized');
die('You hit cancel button');
else // user/pass submitted through dialog
echo "You entered {$_SERVER['PHP_AUTH_USER']} as username.<br>";
echo "You entered {$_SERVER['PHP_AUTH_PW']} as password.<br>";

08-06-2003, 07:28 AM
You can do it with ASP/IIS too. You just change the permissions on the files or folders.