SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: htaccess

  1. #1
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whats the encryption method used by it so one can dynamically add and remove users??
    i dunno...

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    crypt()

    It is one way encryption so there is no decrypting it. Only encrypting for adding to a htpasswd file.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so suppose the user input was
    $newpass = "newpass";

    $crypt_passowrd = crypt($newpass);

    this would work?
    i dunno...

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here are two functions I use to generate unix passwords for use in htpasswd files:

    PHP Code:
            function random() {
                  
    srand ((double) microtime() * 1000000);
                  return 
    rand();
                }

            function 
    crypt_password($password) {
                
    $salt random();
                
    $salt substr($salt02);
                return 
    crypt($password$salt);
                } 
    You will still need to use php to open the htpasswd file and write the new entries to it though.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx!!!
    i dunno...


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
  •