Home >Backend Development >PHP Tutorial >DedeCMS background, the page is not displayed, the background page is blank

DedeCMS background, the page is not displayed, the background page is blank

WBOY
WBOYOriginal
2016-07-30 13:30:171304browse
I want to try DreamWeaver's products, so I downloaded the DedeCMS V5.7 version. After local deployment, there is no output or display on the page when you log in to the background correctly (it will only be displayed when you log in incorrectly or the password is wrong), and there is no error. Entering script debugging, I found that the problem lies in the following parts of the login page login.php. login.php

[php] view plaincopy

  1. ...
  2.                                                                        empty
  3. ($userid) && !empty($pwd))
  4.                                                                                                    >checkUser($userid,$pwd);                                                                                                                                                                                                                                                                                                                                        
  5.                                                                                  
  6. $gotopage))                                                                                                                                                                                                             ,$gotopage);
  7. (); }
  8.                                                                                                                                                             ​.php");
  9.                                                                                                                                                                              
  10. ...
  11. Go to the script userlogin.class.php that encapsulates the userLogin class (path./include/). The code of the keepUser() method used is as follows: userlogin.class.php
  12. [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.   
    9.         @session_register($this->keepUserIDTag);  
    10.         $_SESSION[$this->keepUserIDTag] = $this->userID;  
    11.   
    12.         @session_register($this->keepUserTypeTag);  
    13.         $_SESSION[$this->keepUserTypeTag] = $this->userType;  
    14.   
    15.         @session_register($this->keepUserChannelTag);  
    16.         $_SESSION[$this->keepUserChannelTag] = $this->userChannel;  
    17.   
    18.         @session_register($this->keepUserNameTag);  
    19.         $_SESSION[$this->keepUserNameTag] = $this->userName;  
    20.   
    21.         @session_register($this->keepUserPurviewTag);  
    22.         $_SESSION[$this->keepUserPurviewTag] = $this->userPurview;  
    23.   
    24.         @session_register($this->keepAdminStyleTag);  
    25.         $_SESSION[$this->keepAdminStyleTag] = $adminstyle;  
    26.   
    27.         PutCookie('DedeUserID'$this->userID, 3600 * 24, '/');  
    28.         PutCookie('DedeLoginTime', time(), 3600 * 24, '/');  
    29.   
    30.         $this->ReWriteAdminChannel();  
    31.   
    32.         return 1;  
    33.     }  
    34.     else  
    35.     {  
    36.         return -1;  
    37.     }  
    38. }  

    Remove @, session_register() reports an error:
    Call to undefined function session_register()
    Confirms that the problem comes from this. The description in the manual 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 The manual

    session_register() is redundant in later versions of PHP 5.4. You can omit it and use $_SESSION['abc'] ="" directly;


    View Stack Overflow questions about this method.


    Solution: Remove or comment out all session_register(), and use direct storage of the $_SESSION array instead.

    keepUser() part

    [php] view plaincopy

    1. ...
    2. //session_register($this->keepUserIDTag); [$this
    3. -> ;keepUserIDTag] = $this->userID; //session_register($this->keepUserTypeTag);
    4. $_SESSION[ $this
    5. ->keepUserTypeTag] = $this->userType; //session_register($this->k eepUserChannelTag);
    6. $_SESSION[$this
    7. ->keepUserChannelTag] = $this->userChannel; //session_register($this-> keepUserNameTag);
    8. $_SESSION[$this
    9. ->keepUserNameTag] = $this->userName; / /session_register($this->keepUserPurviewTag);
    10. $_SESSION[$this
    11. ->keepUserPurviewTag] = $this ->userPurview; //session_register($this->keepAdminStyleTag);
    12. $_SESSION[$this
    13. ->keepAdminStyleTag] = $adminstyle ; ...
    14. After modification, it will display normally.
    15. I downloaded the "latest" version from the Dreamweaver homepage. It's strange that no one has encountered the same problem. Since this kind of problem can occur here, there is no guarantee that there will not be more such hidden dangers in other parts.
    16. The above introduces the DedeCMS backend. The page is not displayed and the backend page is blank, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Variable issues in PHPNext article:Variable issues in PHP