note 69808 added to function.crypt
| From: | picolobo at pilab dot dyndns dot org | Date: | Thu, 21 Sep 2006 20:49:12 +0000 |
| Subject: | note 69808 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117398@lists.php.net to get a copy of this message | ||
I had problems with ENCRYPT MySQL function when i tried to compare with the encrypted password (with
ENCRYPT).
Another solution i read from "UNIX Advanced programming" where i found about the UNIX
system call "crypt()":
Password="tB" //The two first letters of encrypted password
SELECT password from users where
Password=ENCRYPT('".$_POST['password']."',Password)
mysql> select password from users where password=encrypt('pasword','tB');
+---------------+
| password |
+---------------+
| tBY8OVuabSiTU |
+---------------+
1 row in set (0.01 sec)
Bye.
> topace at lightbox dot org
> 22-Sep-2005 06:34
>
> To authenticate against a stored crypt in MySQL, simply use:
>
> SELECT ................
> AND Password=ENCRYPT('".$_POST['password']."',Password)
----
Server IP: 130.206.1.5
Probable Submitter: 87.217.128.140
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit -- https://master.php.net/note/edit/69808
Del: integrated -- https://master.php.net/note/delete/69808/integrated
Del: useless -- https://master.php.net/note/delete/69808/useless
Del: bad code -- https://master.php.net/note/delete/69808/bad+code
Del: spam -- https://master.php.net/note/delete/69808/spam
Del: non-english -- https://master.php.net/note/delete/69808/non-english
Del: in docs -- https://master.php.net/note/delete/69808/in+docs
Del: other reasons-- https://master.php.net/note/delete/69808
Reject -- https://master.php.net/note/reject/69808
Search -- https://master.php.net/manage/user-notes.php