note 54782 deleted from function.md5 by mazzanet

From: Date: Mon, 03 Oct 2005 09:43:42 +0000
Subject: note 54782 deleted from function.md5 by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-96270@lists.php.net to get a copy of this message
Note Submitter: Heero E Yuy ---- Great Suggestion Helpful Harry. One tiny Problem on the encode function. When the seed initially tries to concatenate itself, you end up with the following error in your web log (or in the php error log on older PHP compilations): PHP Notice: Undefined variable: seed in yourpath/this_password_func.php on line 17 ... rewrote the encode function alittle: <?php function pw_encode($password) { $seed = NULL; for ($i = 0; $i < 8; $i++) { $seed .= substr('0123456789abcdef', rand(0,15), 1); } $encoded_string = md5($seed.$password).$seed; return $encoded_string; } ?> Hope this helps, helped me... GREAT FUNCTIONS HARRY, I ESPECIALL LIKE THIS ONE, THANK YOU AGAIN!!!

« previous php.notes (#96270) next »