Want to try to weave dream products, download the Dedecms V5.7 version, after the local deployment, the correct login background in the case of the page does not have any output and display (Error login or password error when the display), there is no error. Go to script debugging and find that the problem is in the following section of the login page login.php.
login.php
[Php]view plaincopy
- ...
- $cuserLogin = New userlogin ($admindir);
- if (! Empty ($userid) &&! Empty ($pwd))
- {
- $res = $cuserLogin ->checkuser ($userid,$pwd);
- //success
- if ($res==1)
- {
- $cuserLogin ->keepuser (); //No output below
- if (! Empty ($gotopage))
- {
- ShowMsg (' successful login ' is turning to admin admin homepage! ',$gotopage);
- Exit ();
- }
- Else
- {
- ShowMsg (' successful login ' is turning to admin admin homepage! ',"index.php");
- Exit ();
- }
- Echo "OK";
- }
- ...
To view (path./include/) in the script userlogin.class.php where the Userlogin class is encapsulated, the Keepuser () method code used is as follows:
userlogin.class.php
[Php]view plaincopy
- ...
- function Keepuser ()
- {
- if ($this->userid! = " && $this->usertype! = '')
- {
- Global $admincachefile,$adminstyle;
- if (empty($adminstyle)) $adminstyle = ' Dedecms ' ;
- @session_register ($this->keepuseridtag);
- $_session [$this->keepuseridtag] = $this ->userid;
- @session_register ($this->keepusertypetag);
- $_session [$this->keepusertypetag] = $this ->usertype;
- @session_register ($this->keepuserchanneltag);
- $_session [$this->keepuserchanneltag] = $this ->userchannel;
- @session_register ($this->keepusernametag);
- $_session [$this->keepusernametag] = $this ->username;
- @session_register ($this->keepuserpurviewtag);
- $_session [$this->keepuserpurviewtag] = $this ->userpurview;
- @session_register ($this->keepadminstyletag);
- $_session [$this->keepadminstyletag] = $adminstyle ;
- Putcookie (' Dedeuserid ', $this->userid, 3600 *, '/' );
- Putcookie (' dedelogintime ', Time (), 3600 *, '/');
- $this ->rewriteadminchannel ();
- return 1;
- }
- Else
- {
- return -1;
- }
- }
To remove the @, Session_register () reported the error:
Call to undefined function session_register ()
Confirmed the problem stems from this. The description of the handbook is as follows:
"Version: (PHP 4, PHP 5 < 5.4.0)"
"This function has been deprecated since PHP 5.3.0 and will be removed from PHP 5.4.0. "
View Manuals
Session_register () in the later version of PHP5.4 has been redundant, can be omitted and directly with the $_session[' abc '] = "";
View the stack overflow questions about this method.
Workaround: Remove or comment out all session_register () and use the direct save $_session array instead.
Keepuser () section
[Php]view plaincopy
- ...
- //session_register ($this->keepuseridtag);
- $_session [$this->keepuseridtag] = $this ->userid;
- //session_register ($this->keepusertypetag);
- $_session [$this->keepusertypetag] = $this ->usertype;
- //session_register ($this->keepuserchanneltag);
- $_session [$this->keepuserchanneltag] = $this ->userchannel;
- //session_register ($this->keepusernametag);
- $_session [$this->keepusernametag] = $this ->username;
- //session_register ($this->keepuserpurviewtag);
- $_session [$this->keepuserpurviewtag] = $this ->userpurview;
- //session_register ($this->keepadminstyletag);
- $_session [$this->keepadminstyletag] = $adminstyle ;
- ...
after the modification, it is displayed normally.
I am the "latest" version downloaded from the Dream home page, and it is strange that no one has encountered the same problem. Since this problem can be seen here, there is no guarantee that there will be no more such pitfalls.
The above describes the Dedecms backstage, the page is not displayed, the background page blank, including the content, I hope the PHP tutorial interested in a friend helpful.