Turbocom
05-09-2008, 02:48 AM
Alright so last night I was up all night just trying to figure this out, and its not even a good one so I need help. Basically I read a ton of Tutorials and I didn't read any good ones. So basically I need a password protected page.
When logged in with the password its redirected to another page, anyways heres what I have
<?php
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<p align="center"><br><br><br>
<b>Congratulations</b><br>you have gained access to the Protected and Secret Area!</p>
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"center\">Please enter your password for access<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Login\" type=\"submit\"></p></form>";
}
+ Rep to all who help
When logged in with the password its redirected to another page, anyways heres what I have
<?php
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<p align="center"><br><br><br>
<b>Congratulations</b><br>you have gained access to the Protected and Secret Area!</p>
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"center\">Please enter your password for access<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Login\" type=\"submit\"></p></form>";
}
+ Rep to all who help