DEDECMS中文注册会员无法打开空间的解决方法
发布时间:2020-12-14 03:46:59 所属栏目:Dedecms 来源:网络整理
导读:解决中文注册的会员空间打不开问题 这个问题我也很苦恼,不过还是被解决了。大家分享下哈。 其实说到底还是个字符编码转换问题。 因为汉字没有在判断uid值时出现了错误,导致系统无法识别用户,所以发生了你访问的用户可能已经被删除!错误 方法是 在memberco
解决中文注册的会员空间打不开问题 这个问题我也很苦恼,不过还是被解决了。大家分享下哈。 其实说到底还是个字符编码转换问题。 因为汉字没有在判断uid值时出现了错误,导致系统无法识别用户,所以发生了“你访问的用户可能已经被删除!”错误 方法是 在“memberconfig.php”文件的最后,PHP结束之前添加 isUTF8($str)函数 function isUTF8($str){ $length=strlen($str); for($i=0;$i<$length;$i++){ $high=ord($str{$i}); if(($high==0xC0)||($high==0xC1)){ return false; }elseif($high<0x80){ continue; }elseif($high<0xC0){ return false; }elseif($high<0xE0){ if(++$i>=$length) return true; elseif(($str{$i}&"xC0")=="x80") continue; }elseif($high<0xF0){ if(++$i>=$length){ return true; }elseif(($str{$i}&"xC0")=="x80"){ if(++$i>=$length) return true; elseif(($str{$i}&"xC0")=="x80") continue; } }elseif($high<0xF5){ if(++$i>=$length){ return true; }elseif(($str{$i}&"xC0")=="x80"){ if(++$i>=$length){ return true; }elseif(($str{$i}&"xC0")=="x80"){ if(++$i>=$length) return true; elseif(($str{$i}&"xC0")=="x80") continue; } } } return false; } return true; } 然后修改“memberindex.php”中的代码:将 $tmpstr = @gb2utf8($uid); $tmpstr2 = @utf82gb($tmpstr); if($tmpstr2==$uid) $uid = $tmpstr; 修改为 if(!isUTF8($uid)) $uid = @gb2utf8($uid); 问题解决。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |