Zing
11-17-2002, 05:12 PM
Hi, I was wondering if anyone could help me with a simple php script which uses the following headers to generate the login box:
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
Then Authenticates against the main mysql user database, so if user jondoe was setup with a pass in mysql it would also function for this script (obviously script would need root mysql privs, not a problem).
I tried including the PHPMyAdmin scripts but those screw up the way my script works and i'm pretty sure it'd only take a few select statements to do, problem is i've only done it where id is either over 1 then if there's no id found it wouldn't authenticate, but mysql user db has no id column.
If anyone could create a few lines of code to authenticate against the main mysql user table this would be awesome. just echo something for "authorised" "not authorised - you smell" ;)
Best Regards
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
Then Authenticates against the main mysql user database, so if user jondoe was setup with a pass in mysql it would also function for this script (obviously script would need root mysql privs, not a problem).
I tried including the PHPMyAdmin scripts but those screw up the way my script works and i'm pretty sure it'd only take a few select statements to do, problem is i've only done it where id is either over 1 then if there's no id found it wouldn't authenticate, but mysql user db has no id column.
If anyone could create a few lines of code to authenticate against the main mysql user table this would be awesome. just echo something for "authorised" "not authorised - you smell" ;)
Best Regards
