<div id="main">
<?
function showForm($error=""){
?>
<img src="images/login.gif">
<div id="main"><img src="images/squares.gif" /> Please enter your password to view and download the forms provided by us.</div>
<?
?>
<body>
<?php echo $error; ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="pwd">
<table>
<tr>
<td><input name="passwd" type="password"/></td>
<td align="center"><input type="submit" name="submit_pwd" value="Login"/>
</td>
</tr>
</table>
</form>
</body>
<?php
}
?>
<?
$Password = 'demo'; // Set your password here
if (isset($_POST['submit_pwd'])){
$pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
if ($pass != $Password) {
?>
<div id="title"><b>Wrong Password!</b></div>
<?
showForm("");
include "footer.php";
exit();
}
} else {
showForm();
include "footer.php";
exit();
}
?>
</div>
I have my forms.php file that requires the protector.php (the one showed above). Any suggestions would be appreciated.
Edited by Hayezb, 14 July 2008 - 02:08 PM.
