`<?php
mysqli_connect("localhost", "root", "", "groboch123"); ?>
<?php
$Realm = "<big><span style='color:green; font-weight:bold;'/>Worked!</span></big>";?>
<?php
if (!isset($_SERVER['PHP_AUTH_USER']))/*Need to be !isset*/{
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Lorem Ipsum'; /* Make the user see this */
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
?>`
I am trying to create an authorized login.
I'm looking for ways here to improve my code. I want the Lorem Ipsum to be the Realm. :) Hopefully, this can get done someway.
This will be a great video game for computers. I am trying to add this prompt. Or, alternatively, if this is an too expensive method maybe using the prompt() to validate credentials??
So, I figured out the answer myself. Using {}, in the way it's possible.