LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-11-2006, 03:30 PM   #1
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Rep: Reputation: 30
PHP generate htpasswd


What do I need to do with PHP to encrypt a password for use in a .htpasswd file?
 
Old 06-12-2006, 11:00 AM   #2
fedora4002
Member
 
Registered: Mar 2004
Posts: 135

Rep: Reputation: 15
More details, please.
 
Old 06-12-2006, 11:12 AM   #3
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
I think I have what I want.

PHP Code:
// Encrypt a password for a .htpasswd file.
function enc_pass($pass)
{
    
$pass crypt(trim($pass),base64_encode(CRYPT_STD_DES));
    return 
$pass;

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to htpasswd saqib_javed Linux - General 1 02-17-2006 02:57 AM
htpasswd integra_twinz Linux - Newbie 10 11-01-2005 10:08 AM
"How to Generate PHP files Dynamically" manikantha Programming 5 09-26-2004 12:00 PM
htpasswd problems!!!! elam Linux - Software 1 05-15-2004 03:09 AM
htpasswd steve_c Linux - General 10 04-16-2002 10:15 AM


All times are GMT -5. The time now is 08:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration