bahattab
05-12-2009, 08:28 PM
Encrypt your password for .htpasswd
Want your own script that you can use to make the encrypted password lines for your .htpasswd file? Use this one.
You can download (http://tips-scripts.com/encrypt.txt) this script as a .txt file. Remember to rename the file as a .php file.
- - Start Script Here - -
<?php
if (!empty($_POST[password]) AND !empty($_POST[user])) {
$user = $_POST[user];
$password = $_POST[password];
$encryptedPassword = crypt($password);
}
$script = $_SERVER['SCRIPT_NAME'];
echo "<html><head><title>Password Encryption</title></head><body>
<form method=post action='$script'>
<font size=5><b>.htpasswd File Password Encryption</b></font>
<br><br>Enter Username<br>
<input name=user value='$user' size=20>
<br><br>Enter Password<br>
<input name=password value='$password' size=20>
<br><br><input type=submit name=submit value='Encrypt Now'>
";
if (!empty($user) AND !empty($encryptedPassword)) {
echo "<br><br>.htpasswd File Code<br>$user:$encryptedPassword";
}
echo "</form></body></html>";
?>
- - End Script Here - -
http://tips-scripts.com/encrypt
Want your own script that you can use to make the encrypted password lines for your .htpasswd file? Use this one.
You can download (http://tips-scripts.com/encrypt.txt) this script as a .txt file. Remember to rename the file as a .php file.
- - Start Script Here - -
<?php
if (!empty($_POST[password]) AND !empty($_POST[user])) {
$user = $_POST[user];
$password = $_POST[password];
$encryptedPassword = crypt($password);
}
$script = $_SERVER['SCRIPT_NAME'];
echo "<html><head><title>Password Encryption</title></head><body>
<form method=post action='$script'>
<font size=5><b>.htpasswd File Password Encryption</b></font>
<br><br>Enter Username<br>
<input name=user value='$user' size=20>
<br><br>Enter Password<br>
<input name=password value='$password' size=20>
<br><br><input type=submit name=submit value='Encrypt Now'>
";
if (!empty($user) AND !empty($encryptedPassword)) {
echo "<br><br>.htpasswd File Code<br>$user:$encryptedPassword";
}
echo "</form></body></html>";
?>
- - End Script Here - -
http://tips-scripts.com/encrypt