rrsnider
12-18-2001, 11:31 AM
Is there a way to open a dialog box in PHP ? I want to use an HTML form to validate users and like the professional look of the dialog box but I don't want to use Basic HTTP Authentication. It's probably not possible, but I thought I would ask.
Thanks.
bobcares
12-18-2001, 02:44 PM
Hi!
As you have correctly mentioned one method is the httpd auth method.
Why not try some javascript with php. This would help you get around the problem.
Have a great day :)
regards
amar
DavidU
12-19-2001, 10:55 PM
Originally posted by rrsnider
Is there a way to open a dialog box in PHP ? I want to use an HTML form to validate users and like the professional look of the dialog box but I don't want to use Basic HTTP Authentication. It's probably not possible, but I thought I would ask.
Thanks.
It's more then possible:
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"Everydns\"");
Header("HTTP/1.0 401 Unauthorized");
// They did not authenticate
exit;
} else {
// They authenticated
}
Just pass them to that page, once they fill in the values for username and password it gets set as $PHP_AUTH_USER and $PHP_AUTH_PW. Use those to authenticate via mysql or whatever.
Here's a help page that you could have easily found yourself by searching the php.net manual. (*HINT*)
http://www.php.net/manual/en/features.http-auth.php
greetz,
davidu