I have deployed a simple PHP-based application (http://www.bigprof.com/appgini/) on my local network. I would like a way to implement a way for users to automatically log in. Security is a non-issue. Would it be possible to modify the login page to accept something like http://user:[email protected]/?
This is the source of the login page, if that helps.
Any help would be greatly appreciated.
HTTP Basic Auth credentials are available in PHP in the $_SERVER superglobal in the keys PHP_AUTH_USER and PHP_AUTH_PW.
From http://php.net/manual/en/features.http-auth.php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
For more sophisticated ways of doing authentication check out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With