SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    adding users and passwords to a .htpasswd file

    Hi

    If I use a PHP script to automatically add users and there passwords to my .htpasswd file as they register. How, using my script do I encrypt the password before writing it to the .htpasswd file?

    Any help will be most appreciated.

    Thanks

    Estella

  2. #2
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Staffordshire, UK & Florida, USA
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could call htpasswd using exec(), which will update your .htpasswd file for you. Do man htpasswd for information on the flags and parameters to use. You should also check the PHP functions escapeshellarg() and escapeshellcmd() if you are using exec() with user-supplied variables!

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks That makes sense.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Massachussetts, US
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use flat files.
    Do a search for it at php.net and read how to program something that would write variables to the site.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •