Location: PHPKode > projects > FiForms Framework > FiForms/scripts/mkpasswd.php
<?php
/*
 * Created on Dec 7, 2006
 *
 */
$passwd_hash = "";
if($_POST['passwd'])
{
    if($_POST['passwd'] == $_POST['passwd_conf'])
    {
        $passwd_hash = "<p>Following is the password hash value that you should use in your configuration file:</p><pre>".sha1($_POST['passwd'])."</pre><p><a href=\"index.php\">Return to Menu</a></p>";
    }
    else
    {
        $passwd_hash = "<p>Sorry, the passwords you entered do not match. Please enter the same password twice.<br /><a href=\"javascript:history.go(-1);\">Return to Password Screen.</a>";
    }
}
?>
<html>
<head>
<title>Generate SHA1 Password Hash</title>
</head>
<body>
<?php 
if($passwd_hash)
{
echo $passwd_hash; 
}
else
{
?>
<form action="mkpasswd.php" method="post">
<table>
<tr><th>Enter Password</th>
<td>
<input type="password" name="passwd" />
</td>
</tr>
<tr>
<th>Confirm Password</th>
<td>
<input type="password" name="passwd_conf" />
</td>
</tr>
<tr>
<th></th>
<td><input type="submit" value="Generate SHA1 Hash" />
</td>
</tr>
</table>
</form>
<p><a href="index.php">Return to Menu</a>
<?php } ?>
</body>
</html>
Return current item: FiForms Framework