DedeCMS background, the page is not displayed, the background page is blank
Release: 2016-07-30 13:30:17
Original
1296 people have browsed it
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
- ...
empty- ($userid) && !empty($pwd))
-
>checkUser($userid,$pwd);
- $gotopage)) ,$gotopage);
-
(); }
- .php");
- ...
- 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
[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 * 24, '/');
- PutCookie('DedeLoginTime', time(), 3600 * 24, '/');
-
- $this->ReWriteAdminChannel();
-
- return 1;
- }
- else
- {
- return -1;
- }
- }
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
- ...
- //session_register($this->keepUserIDTag);
[$this
- -> ;keepUserIDTag] = $this->userID; //session_register($this->keepUserTypeTag);
-
-
$_SESSION[ $this
- ->keepUserTypeTag] = $this->userType; //session_register($this->k eepUserChannelTag);
-
-
$_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 modification, it will display normally. -
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.
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 of this Website
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
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31