note 57010 added to function.crypt
| From: | kartikborikar at yahoo dot com | Date: | Wed, 21 Sep 2005 15:28:43 +0000 |
| Subject: | note 57010 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95538@lists.php.net to get a copy of this message | ||
Crypt function can be used to generate encrypted password used for HTACCESS authentication.
$random_salt=rand(10000,1000000);
$crypted_password=crypt($Password, $random_salt);
Each time we run this script we get a different HTACCESS password.
<? echo $username; ?>:<? echo $crypted_password;?>
The above text gives the text to be included in the password file of HTACCESS.
You can see this working at http://support.kkeim.com/utilities/htaccess/
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57010
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57010&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57010&report=yes
Search -- http://master.php.net/manage/user-notes.php