4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu
Please consider registering: registration is fast, easy and free! Benefits of registration:
  • Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
  • Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
  • Private Messages: Exchange private messages with other members of the forums.
  • Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.

 Change Password using PHP in .htaccess file
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
!!harsh789
Junior WebHelper
Junior WebHelper


Joined: 18 Oct 2006
Posts: 1

PostPosted: Wed Oct 18, 2006 4:53 pm (8 years ago) Reply with QuoteBack to Top

Hi,

Is there any way I can change user passwords in .htaccess file using PHP.

Any help or suggestions are appreciated.

Thanks.

________________________________
http://www.savingsahead.com
OfflineView User's ProfileFind all posts by !!harsh789Send Personal MessageVisit Poster's Website
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Wed Oct 18, 2006 6:55 pm (8 years ago) Reply with QuoteBack to Top

There's no quick, one-line way of doing it that I know of. However, it should be pretty trivial to code something to take care of it. You'd just need to read the contents of the htpasswd file (using fopen()/fread() in PHP4, or file_get_contents() in PHP5), then replace the existing password hash with the new one using something like preg_replace() and write the new file.

This could of course require the htpasswd file to be world-writable depending on your server-configuration, which might be a security consideration you should keep in mind.

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.

PoignantEase
Web design, coding, script installation, phpBB customisation - From a 4WebHelp team member



Page generation time: 0.040164 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme