It is currently Thu Mar 28, 2024 9:09 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: right crypt() function for creating passwords in .htpasswd
PostPosted: Mon Feb 27, 2006 11:49 pm 
I need a script which would generate the needed encrypted symbols for password in .htpasswd file for file protection.
This doesn't seem to work correctly:


if (!empty($_POST['login']) && !empty($_POST['pass'])) {


$newpass=crypt($_POST['pass'], 'rl');
$newpass=$newpass."\n";

$inputfp=fopen(".htpasswd", "a");
$inputnew=fputs($inputfp, $_POST['login'].":".$newpass);
fclose($inputfp);
echo "New users added!";




}

It adds the line to .htpasswd file but when I try to log in it fails. Whats wrong with it?


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ]  Moderators: fhmagic, KJ, Moderators, Support Team

All times are UTC


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 post attachments in this forum

Search for:
Jump to:  
100WebSpace © 2011