Hello,
I have the script below and I’m trying to get it to work so that there are several valid passwords. The first script below works with the one password:
[code]<?php
$password = “bob”;
?>
You are a winner
You lose.
";} print "Please enter your code below
";
print "
"; ?>
[/code]
But I’m trying to get several password to work. I’m trying to use an array but it ain’t happening. My attempt is below:
[code]<?php
$password = array(“password1”, “password2”, “password3”, “admin”);
?>
<?php print ""; // If password is valid let the user get access if (isset($_POST["password"]) && ($_POST["password"]=="$password")) { ?>
You are a winner
You lose.
";} print "Please enter your code below
";
print "
"; ?>
[/code]
any help would be much appreciated.
Thanks
Robert
MOD EDIT: Added code tags