最近下了dedecms V5.7时,在登陆后台时,用户名和密码也没错,就是跳转不走,进不了后台管理页面,追踪了好久才发现根目录/include/userlogin.class.php中289行左右的位置及之后的位置
@<span session_register</span>(<span $this</span>->keepUserIDTag);
使用了
<span><span <strong><span session_register</span></strong></span>函数,就在这个地方卡住了,而且还@了错误信息,原来<br /><span> 本函数已自 PHP 5.3.0 起</span><em class="emphasis">废弃</em><span>并将自 PHP 5.4.0 起</span><em class="emphasis">移除</em><span>。我的php版本是5.4.0的<br /></span>解决方法<br />加入代码<br /></span>
<span function</span><span fix_session_register(){ </span><span function</span> <span session_register</span><span (){ </span><span $args</span> = <span func_get_args</span><span (); </span><span foreach</span> (<span $args</span> <span as</span> <span $key</span><span ){ </span><span $_SESSION</span>[<span $key</span>]=<span $GLOBALS</span>[<span $key</span><span ]; } } } </span><span if</span> (!<span function_exists</span>('session_register')) fix_session_register();
就可以啦!
<span> </span>