: 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
- ...
- $ CuserLogin = new userLogin ($ admindir );
- If (! Empty ($ userid )&&! Empty ($ pwd ))
- {
- $ Res = $ cuserLogin-> checkUser ($ userid, $ pwd );
- // Success
- If ($ res = 1)
- {
- $ CuserLogin-> keepUser (); // no output is shown below
- If (! Empty ($ gotopage ))
- {
- ShowMsg ('successfully logged on, switching to the management homepage! ', $ Gotopage );
- Exit ();
- }
- Else
- {
- ShowMsg ('successfully logged on, switching to the management homepage! ', "Index. php ");
- Exit ();
- }
- Echo "OK ";
- }
- ...
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
- ...
- 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 ('deuserid', $ this-> userID, 3600*24 ,'/');
- PutCookie ('delogintime', time (), 3600*24 ,'/');
-
- $ This-> ReWriteAdminChannel ();
-
- Return 1;
- }
- Else
- {
- Return-1;
- }
- }
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
- ...
- // 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 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.