DedeCMS background, no page displayed, blank background page

Source: Internet
Author: User
: This article mainly introduces the DedeCMS background. the page is not displayed and the background page is blank. if you are interested in the PHP Tutorial, refer to it. I want to try Zhimeng's product and download DedeCMS V5.7. after local deployment, when you log on to the background correctly, the page does not display any output or display (displayed only when the logon or password is incorrect), and no error is reported. Go to script debugging and find that the problem lies in the following part of the login. php logon page.

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 is shown below
  10. If (! Empty ($ gotopage ))
  11. {
  12. ShowMsg ('successfully logged on, switching to the management homepage! ', $ Gotopage );
  13. Exit ();
  14. }
  15. Else
  16. {
  17. ShowMsg ('successfully logged on, switching to the management homepage! ', "Index. php ");
  18. Exit ();
  19. }
  20. Echo "OK ";
  21. }
  22. ...


To the script userLogin. class. php that encapsulates the userlogin class (path./include/), 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 ('deuserid', $ this-> userID, 3600*24 ,'/');
  21. PutCookie ('delogintime', time (), 3600*24 ,'/');
  22. $ This-> ReWriteAdminChannel ();
  23. Return 1;
  24. }
  25. Else
  26. {
  27. Return-1;
  28. }
  29. }


If @ is removed, session_register () reports an error:
Call to undefined function session_register ()
Confirmed the problem. The manual is described as follows:
"Version: (PHP 4, PHP 5 <5.4.0 )"
"This function has been removed from PHP 5.3.0 and has been removed from PHP 5.4.0. "

View manual

Session_register () is redundant in later versions of PHP5.4. Instead, you can directly use $ _ SESSION ['ABC'] = "";


View the problem about this method in Stack Overflow.


Solution: Remove or comment out all session_register () and save the $ _ SESSION array directly.

KeepUser ()

[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 modification, it will be displayed normally.

I downloaded the "latest" version from the Zhimeng homepage. Is it strange that no one has encountered the same problem. Since this problem can occur, other parts cannot guarantee that there will be no more such hidden risks.

The DedeCMS background is described above. the page is not displayed, and the background page is blank. It includes some content. I hope you will be helpful to those interested in PHP tutorials.

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.