Jump to content

Recommended Posts

Posted

There was another thread about a php login script and it brought back to mind this .htpasswd file password generator for password protected directories. It's a little easier than going through the cpanel steps to add another user. Just make sure when you paste in the new user and password that it begins on a new line in the .htpasswd file.

 

http://byrondallas.heliohost.org/alpha1ome...pt_password.php

 

<html>
<head>
<title>.htpasswd File Password Encryption</title>
</head>
<body>
<h2>.htpasswd File Password Encryption</h2>
<form method="post" action="">
Enter Username<br>
<input name="user" value="<?php echo $_POST[user]; ?>" size="20">
<br><br>
Enter Password<br>
<input name="password" value="<?php echo $_POST[password]; ?>" size="20">
<br><br>
<input type="submit" name="submit" value="Encrypt">
<br><br>
<?php
if ( $_POST[password] && $_POST[user] )
{
$user = $_POST[user];
$password = $_POST[password];
$encryptedPassword = crypt($password);
echo ".htpasswd File Code<br>\n";
echo "<input type=\"text\" size=\"50\" value=\"$user:$encryptedPassword\">";
}
?>
</form>
</body>
</html>

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...