i want my script to auth users, it's a back end script 🙂
i suppose i could do it whereby i just send out some text inputs but i want to pursue this method anyway.
firstly i was using:
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="News Administration"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}elseif{
#blah!
}
but apache didn't like this (malformed header according to the error log though i see nothing wrong with it)
so then i decided to use .htaccess files.
i've now got this working but the auth compares the passwords as plain text, which i don't really want... how can i sort this in apache?
lastly...
now $PHP_AUTH_USER doesn't work as i'm not using php to call the login screen (i guess), how can i get the username of the person logged in?
as i'm using .htaccess files $PHP_AUTH_USER doesn't work..