Reputation: 149
I have a super simple page that uses a PHP password script to allow users access. It works like a charm, but I need to add a second password for another user. Does anyone know how to solve this?
Thank you!
/A
PHP:
<?php
// Define your password
$password = "xxx";
if ($_POST['txtPassword'] != $password) {
?>
HTML:
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p>Enter Password</p><br>
<input type="password" name="txtPassword" style="width: 400px;">
</form>
Upvotes: 1
Views: 2333
Reputation: 1018
$passwords = array('xxx', 'zzz', 'yyy');
if (!in_array($_POST['txtPassword'], $passwords, true)) {
}
Upvotes: 1