help with password
Posted: Mon Aug 22, 2011 5:25 pm
I want to use multiple passwords for a webpage using an include link.
I am trying to use password= password1 or password2:
$password = ("sunju") || ("cancer");
but does not work, works with only one.
Using code below on the webpage
<?php
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"left\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"left\">Please enter your password for access <b>(must be in lower case)</b><br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"20\"><input value=\"Login\" type=\"submit\"></p></form>";
}
?>
I am trying to use password= password1 or password2:
$password = ("sunju") || ("cancer");
but does not work, works with only one.
Using code below on the webpage
<?php
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"left\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"left\">Please enter your password for access <b>(must be in lower case)</b><br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"20\"><input value=\"Login\" type=\"submit\"></p></form>";
}
?>