問題現象:
註冊的時候,輸入正確的郵箱,或者密碼確認的時候 ,提示輸入不正確
問題原因:
由於註冊表單中 name 是隨機產生的,當產生 name 為純數字的時候會產生問題。
解決方案:
打開 function_core.php,找到 random 函數
- function random($length, $numeric = 0) {
- $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
- $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
- $hash = '';
- $max = strlen($seed) - 1;
- for($i = 0; $i < $length; $i++) {
- $hash .= $seed{mt_rand(0, $max)};
- }
- return $hash;
- }
更改為:
- function random($length, $numeric = 0) {
- $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
- $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
- if($numeric) {
- $hash = '';
- } else {
- $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64);
- $length--;
- }
- $max = strlen($seed) - 1;
- for($i = 0; $i < $length; $i++) {
- $hash .= $seed{mt_rand(0, $max)};
- }
- return $hash;
- }