Dedecms background, page no display, background page blank

Source: Internet
Author: User
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

  1. ...
  2. $cuserLogin = New userlogin ($admindir);
  3. if (! Empty ($userid) &&! Empty ($pwd))
  4. {
  5. $res = $cuserLogin ->checkuser ($userid,$pwd);
  6. //success
  7. if ($res==1)
  8. {
  9. $cuserLogin ->keepuser (); //No output below
  10. if (! Empty ($gotopage))
  11. {
  12. ShowMsg (' successful login ' is turning to admin admin homepage! ',$gotopage);
  13. Exit ();
  14. }
  15. Else
  16. {
  17. ShowMsg (' successful login ' is turning to admin admin homepage! ',"index.php");
  18. Exit ();
  19. }
  20. Echo "OK";
  21. }
  22. ...


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

  1. ...
  2. function Keepuser ()
  3. {
  4. if ($this->userid! = " && $this->usertype! = '')
  5. {
  6. Global $admincachefile,$adminstyle;
  7. if (empty($adminstyle)) $adminstyle = ' Dedecms ' ;
  8. @session_register ($this->keepuseridtag);
  9. $_session [$this->keepuseridtag] = $this ->userid;
  10. @session_register ($this->keepusertypetag);
  11. $_session [$this->keepusertypetag] = $this ->usertype;
  12. @session_register ($this->keepuserchanneltag);
  13. $_session [$this->keepuserchanneltag] = $this ->userchannel;
  14. @session_register ($this->keepusernametag);
  15. $_session [$this->keepusernametag] = $this ->username;
  16. @session_register ($this->keepuserpurviewtag);
  17. $_session [$this->keepuserpurviewtag] = $this ->userpurview;
  18. @session_register ($this->keepadminstyletag);
  19. $_session [$this->keepadminstyletag] = $adminstyle ;
  20. Putcookie (' Dedeuserid ', $this->userid, 3600 *, '/' );
  21. Putcookie (' dedelogintime ', Time (), 3600 *, '/');
  22. $this ->rewriteadminchannel ();
  23. return 1;
  24. }
  25. Else
  26. {
  27. return -1;
  28. }
  29. }


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

  1. ...
  2. //session_register ($this->keepuseridtag);
  3. $_session [$this->keepuseridtag] = $this ->userid;
  4. //session_register ($this->keepusertypetag);
  5. $_session [$this->keepusertypetag] = $this ->usertype;
  6. //session_register ($this->keepuserchanneltag);
  7. $_session [$this->keepuserchanneltag] = $this ->userchannel;
  8. //session_register ($this->keepusernametag);
  9. $_session [$this->keepusernametag] = $this ->username;
  10. //session_register ($this->keepuserpurviewtag);
  11. $_session [$this->keepuserpurviewtag] = $this ->userpurview;
  12. //session_register ($this->keepadminstyletag);
  13. $_session [$this->keepadminstyletag] = $adminstyle ;
  14. ...


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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.