|
|
| Author |
|
b0b0
Guru Wanabe

Stars : 
Status : Offline
Join Date: 07 Feb 2007
Posts: 228
Location: Seville, Spain
|
Posted:
Sun Mar 18, 2007 12:10 pm .htaccess/.htpasswd password generator - Save this post |
|
|
Hey
As i've always been struggling to get an online htaccess & htpasswd generator that would give me the same results, so here is one that works anywhere ! (well ... on nix servers only, not on windows ... you might want to try it though !)
what to do?
1 - create the folder you want to protect on your server
2 - upload the attached file (without renaming it!)
3 - go to the url of the file ex: yourdomain.com/folder/htaccesspasswordgenerator.php
Fill the username & password fields and press generate!
The next page will give you the content of the 2 files needed (with the right address in htaccess!)
.htaccess
.htpasswd
htaccesspasswordgenerator.php CODE
| Code: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<title>BLWorks .htaccess / .htpasswd generator</title>
<meta name="revisit-after" content="15 days"/>
<meta name="Subject" content=".htaccess and .htpasswd generator"/>
<meta name="Description" content="generator to protect folders"/>
<meta name="Keywords" content=".htaccess, .htpasswd, b0b0, blworks"/>
<meta name="robots" content="all" />
<meta name="author" content="Baudouin LAMOURERE / BLworks" />
<meta name="audience" content="all" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
html,body {
color : #000000;
font : 12px Verdana, Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<div style="width:50%;text-align:left;margin:20px;">
<?php
if ($_POST['username']!=""){
echo '<b>CONTENT OF .htaccess</b><br/><br/>
# file containing user:password details<br/>
AuthUserFile '.realpath(".").'/.htpasswd<br/>
# What you want to appear on the dialog box when people log in.<br/>
AuthName "Members Area"<br/>
# Authentication type<br/>
AuthType Basic<br/>
# Requirements to be satisfied<br/>
require valid-user<br/><br/>
<b>CONTENT OF .htpasswd</b><br/><br/>
';
echo htmlentities($_POST['username']).":".crypt($_POST['password'])."<br/><br/>*make sure you have a carriage return after the line containing the username:password!";
} else {
echo '
Please enter the username and password you would like to use to access the protected folder
<br /><br />
<form method="post" action="htaccesspasswordgenerator.php">
username: <input type="text" id="username" name="username" /><br /><br />
password: <input type="text" id="password" name="password" /><br /><br />
<input type="submit" value="generate" />
</form>
';
}
?>
</div>
</body>
</html>
|
hoping this helps
b0b0[/code] _________________ http://blworks.net - http://fotoworks.free.fr - http://b0.b0.free.fr |
| Back to top |
|
Advertisement
Advertiser
|
|
|
| Back to top |
|
gogul2k
Guru Wanabe

Stars : 
Status : Offline
Join Date: 10 Feb 2007
Posts: 249
Location: Under your bed
|
|
Sounds like an interesting find Thanks b0b0! _________________ http://www.denegibson.co.uk | http://www.angryghost.info |
| Back to top |
|
b0b0
Guru Wanabe

Stars : 
Status : Offline
Join Date: 07 Feb 2007
Posts: 228
Location: Seville, Spain
|
|
You're welcome
"it's not a find but a creation "
b0b0 _________________ http://blworks.net - http://fotoworks.free.fr - http://b0.b0.free.fr |
| Back to top |
|
|
|