Jump to content

carbomite

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

carbomite's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yea, I used the username/password of 6/6 and I tried it again with moon/moon it still doesn't work with md5() or crypt()
  2. when using $encrypwd = md5($pwd); the .htpasswd file has "6:1679091c5a880faf6fb5e6087eb1b2dc" when using $encrypwd = crypt($pwd); the .htpasswd file has "6:$1$5V0.oV5.$1nmiJJQI5hEcgpfBVwPqa0" these give me the "Password Mismatch" error in the logs but when using an online generator (http://www.htaccesstools.com/htpasswd-generator) I put "6:$apr1$Og2ky/..$0Vs5LvxD54.f3MBEufzNE0" in the .htpasswd file and it works as expected when I log in
  3. Hi, I am trying to create .htaccess and .htpasswd files in PHP using fopen and fwrite. But I don't think I'm encrypting the password correctly for the .htpasswd file. When I enter the username and password on the protected page, I am asked to enter them again. My error logs say "Password Mismatch". I have tried encrypting with: $encrypwd = crypt($pwd); and $encrypwd = md5($pwd); my username, password and create .htpasswd code $name = "6"; $pwd = "6"; $hpfile = $name."/private/.htpasswd"; $fh2 = fopen($hpfile, 'w') or die("can't open file"); $stringData = $name.":".$encrypwd; fwrite($fh2, $stringData); fclose($fh2); When I create a .htpasswd manually (entering the username and using an online htpasswd generator for the encrypted password) I am successful. I am using Xampp Lite, Windows 7, PHP Version 5.3.1 In case it matters Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.