I’ve just submitted a code example to Weberdev for managing .htpasswords based on work by Jarno Elonen. I hadn’t seen any PHP scripts to do this so I was pleased to find it. In the past I’ve always relied on other websites to generate the passwords. The functions weren’t difficult once you know where to look.
It didn’t have the management bits on it so I’ve added them, made the file writing a bit more robust and rereleased the script.
Just three things to change and then you’re off
- change the path for the location of the .htpasswd file
- change the username for the admin
- change the email address that user passwords are emailed from