其实说到底还是个字符编码转换问题。 因为汉字没有在判断uid值时出现了错误,导致系统无法识别用户,所以发生了“你访问的用户可能已经被删除!”错误 方法是在“member\config.
其实说到底还是个字符编码转换问题。
因为汉字没有在判断uid值时出现了错误,导致系统无法识别用户,所以发生了“你访问的用户可能已经被删除!”错误
方法是
在“member\config.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;
}
然后修改“member\index.php”中的代码:将
复制代码代码如下:
$tmpstr = @gb2utf8($uid);
$tmpstr2 = @utf82gb($tmpstr);
if($tmpstr2==$uid) $uid = $tmpstr;
修改为
复制代码代码如下:
if(!isUTF8($uid)) $uid = @gb2utf8($uid);
问题解决。
--结束END--
本文标题: dedecms注册中文会员无法打开空间的解决方法
本文链接: https://www.lsjlt.com/news/31253.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-27
2023-10-27
2023-10-26
2023-10-25
2023-10-21
2023-10-21
2023-10-18
2023-10-12
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0