eXtreme Intelligence talk related to internet technologies
Log in  | Register  | Set Adsense  | Search   |  New Posts  |   My Profile |  Contact Us

Make money by posting...
You can make money by just posting at XiTalk forums now. more details
Username:    Password: or click here to register

Website, Webhost and OS Security 
.htaccess/.htpasswd password generator - Save this topic
XiTalk Forum Index > Website, Webhost and OS Security


          .htaccess/.htpasswd password generator View previous topic . View next topic
Author
Post Details
 
b0b0
Guru Wanabe



Stars :
Status : Offline
Join Date: 07 Feb 2007
Posts: 228
Location: Seville, Spain

PostPosted: Sun Mar 18, 2007 12:10 pm    .htaccess/.htpasswd password generator - Save this post Reply with quote
Hey Wink

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 ! Very Happy (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 Wink

b0b0[/code]
_________________
http://blworks.net - http://fotoworks.free.fr - http://b0.b0.free.fr
Back to top
View user's profile Send private message Visit poster's website  No rating
Advertisement
Advertiser








PostPosted: Sun Mar 18, 2007 12:10 pm    Advertisement - Save this post

Back to top
gogul2k
Guru Wanabe



Stars :
Status : Offline
Join Date: 10 Feb 2007
Posts: 249
Location: Under your bed

PostPosted: Sun Mar 18, 2007 12:31 pm     - Save this post Reply with quote
Sounds like an interesting find Smile Thanks b0b0!
_________________
http://www.denegibson.co.uk | http://www.angryghost.info
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
b0b0
Guru Wanabe



Stars :
Status : Offline
Join Date: 07 Feb 2007
Posts: 228
Location: Seville, Spain

PostPosted: Sun Mar 18, 2007 1:39 pm     - Save this post Reply with quote
You're welcome Wink

"it's not a find but a creation Wink"

b0b0
_________________
http://blworks.net - http://fotoworks.free.fr - http://b0.b0.free.fr
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   

Page 1 of 1
XiTalk Forum Index > Website, Webhost and OS Security




 
Jump to:  
   Similar threads/topics
 Topics   Replies   Author   Views   Last Post 
No new posts give me the name of websites where i can blog free and can e 6 Manish G 14626 Mon Dec 14, 2009 9:17 pm
Niche View latest post
No new posts Hi my name is..... 5 totoymolah 15048 Tue Jul 17, 2007 8:11 pm
littlephoenix View latest post
No new posts How to Register Domain Name and Where? What is the cost of r 11 RD 14920 Sat Mar 17, 2007 5:34 am
Lawerence S View latest post
No new posts Can't find the domain name I just registered online: jjinstg 2 jjinstgeorge 13651 Tue Mar 20, 2007 12:31 am
usman m View latest post
No new posts any tips for buying a domain name ? 4 killer 22024 Mon Feb 12, 2007 4:03 pm
aarun1981 View latest post

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum