This PHP script will generate the necessary encrypted password for a Basic Authentication .htpasswd file based on the given username and password input. After you see/get the .htpasswd line in bold at the end of the page, simply paste the line into your .htpasswd file and wala!
Generated .HTPASSWD line:
Example: userid:encrypted password
default_user:cfOviboMbSsmQ