Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
Crypt to htpasswdCode Wizard, 12-30-2006 |
This simple password crypt script will create a .htaccess and .htpasswd to password protect your directories. All you need to do is copy the code, save the file, chmod the directory your going to protect to 777, run the script, and your dirctory is password protected.
<?
/*Crypt Password script
Created on: April 1, 2001
Copyright© 123 Make Me! All Rights Reserved.
To get this script, goto http://123-makeme.com
This Software is free and can be modified and redistributed
under the condition that the copyright and information above
stays intact and with the script.*/
if(isset($pass)){
$input1="AuthUserFile $loc.htpasswd
AuthGroupFile /dev/null
AuthName "Private"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>";
$crypass=crypt($pass);
$input2="$user:$crypass";
$fp=fopen($loc.".htaccess","a+");
fwrite($fp,$input1);
fclose($fp);
$fp2=fopen($loc.".htpasswd","a+");
fwrite($fp2,$input2);
fclose($fp2);
echo "$loc is now password protected!";
}
echo "<FORM action="$PHP_SELF" method="post">
<table bgcolor="#000000">
<tr>
<td colspan="3">
Crypt Password to .htpasswd
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
Password to Crypt:
</td>
<td bgcolor="#CCCCCC">
<INPUT type="text" name="pass" value="$pass">
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
Username:
</td>
<td bgcolor="#CCCCCC">
<INPUT type="text" name="user" value="$user">
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
Location of .htaccess and .htpasswd file<BR>
<font size="2">Note: Directory must be chmod 777! Also, put a trailing / on the end.</font>
</td>
<td bgcolor="#CCCCCC">
<INPUT type="text" name="loc" value="$loc">
</td>
<td bgcolor="#CCCCCC">
<INPUT type="Submit" value="Crypt!">
</td>
</tr>
</table>
Script created by <A HREF="http://123-makeme.com">123 Make Me!</A>
</FORM>";
?>
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

