虚位以待(AD)
虚位以待(AD)
首页 > CMS教程 > Discuz! > discuz注册提示“邮箱、密码等无效” 临时解决方案

discuz注册提示“邮箱、密码等无效” 临时解决方案
类别:Discuz!   作者:码皇   来源:互联网   点击:

问题现象: 注册的时候,输入正确的邮箱,或者密码确认的时候 ,提示输入不正确问题原因: 由于注册表单中name是随机产生的,当产生name为纯数字的时候会产生问题。解决方案: 打开function_core php,找到 ,魔客吧
问题现象:
注册的时候,输入正确的邮箱,或者密码确认的时候 ,提示输入不正确

问题原因:
由于注册表单中name是随机产生的,当产生name为纯数字的时候会产生问题。

解决方案:
打开function_core.php,找到random函数
  1. function random($length, $numeric = 0) {
  2. $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
  3. $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
  4. $hash = '';
  5. $max = strlen($seed) - 1;
  6. for($i = 0; $i < $length; $i++) {
  7. $hash .= $seed{mt_rand(0, $max)};
  8. }
  9. return $hash;
  10. }
复制代码更改为:
  1. function random($length, $numeric = 0) {
  2. $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
  3. $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
  4. if($numeric) {
  5. $hash = '';
  6. } else {
  7. $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64);
  8. $length--;
  9. }
  10. $max = strlen($seed) - 1;
  11. for($i = 0; $i < $length; $i++) {
  12. $hash .= $seed{mt_rand(0, $max)};
  13. }
  14. return $hash;
  15. }
复制代码
相关热词搜索: discuz注册提示“邮箱、密码等无效” 临时