AdRock Posted June 4, 2008 Share Posted June 4, 2008 I don't need a login system for a website I have built but i do have an area which needs to be protected so i use htaccess. I want to be able to change the password using a form in the protected area if possible but don't know how i would go about changin gthe password. I know how to open and edit a file but is it possible to open and edit a .htpasswrd file using php? And how do i create the password from the given username. If someone could tell me how to do it i'll have a go at coding it as don't know how the password is generated Link to comment https://forums.phpfreaks.com/topic/108688-php-htpasswrd-generatorhow-is-it-done/ Share on other sites More sharing options...
phpzone Posted June 4, 2008 Share Posted June 4, 2008 <?php function create_htpasswd( $clearTextPassword ) { $password = crypt($clearTextPassword, base64_encode($clearTextPassword)); return $password; } ?> Link to comment https://forums.phpfreaks.com/topic/108688-php-htpasswrd-generatorhow-is-it-done/#findComment-557355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.