Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-11-2006, 03:30 PM   #1
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
Registered: Mar 2004
Posts: 135

Rep: Reputation: 15
More details, please.
Old 06-12-2006, 11:12 AM   #3
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));



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

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 07:30 AM.

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