Zblog cannot log on to the background, just refresh the page. Solution

Source: Internet
Author: User

I wanted to update an article last night, but I didn't expect my blog background management to fail to log on. First, determine whether the user name and password are correct. Because my user name and password are encrypted and saved using the RoboForm tool, it is certainly not wrong. Therefore, after manually modifying two Link file templates, such as Link. asp, the website fails to be opened due to an error. Some asp files and databases are replaced. Even so, it is necessary to confirm the password. After the database replaces the correct password and uploads it for test, the database can be logged on to another blog, indicating that the password is correct. Then Baidu and Google checked the cause and found that there were many questions about zblog's inability to log on. There are also several solutions. For example, if you replace common. js, enter the user name, save it for one day, enter the password, and modify the SetCookie js function, I will not be able to try it. I also know some code, so I want to look for the Code related to the program's login processing function. The zbolg architecture is relatively small, and it is really difficult to find a layer by layer. I will use Dreamweaver to batch search for database fields related to user names, it has passed, so it is difficult to find and replace it with the wrong one. Then, the related fields are replaced with null... So I want to try again tomorrow.

Yesterday, I tried to find the database operation code for processing the login result. Today, I started to find the cause from the page where the problem occurred, and soon I found the problem. Click the login button, and the page is refreshed without any processing. Then look at the login. asp code analysis to find the problem. The action value of the form is not directly written in the form, but assigned by js. That is, the action value is submitted if it is not assigned a value. Obviously, js errors exist before the assignment, leading to no value assignment. After analysis, it is found that there are several ";" numbers in js that are not written. Modify and adjust the settings. After the test, you can log on to the system normally. Today, I will write down the incident and solution. Although it is not related to the topic of the dongge Alibaba blog, I also hope to provide some help to my friends who have the same problem in the future.

------------------------ The preceding gossip can be ignored ------------------------

Problem: zblog cannot log on

Symptom: enter the correct user name and password verification code and click the login button. No prompt is displayed. The page is refreshed only.

Zblog cannot be logged in due to many reasons, such as database connection and incorrect password. I believe that the Webmaster can identify or solve these problems. This method is only applicable to the solution of the above phenomena. You can see clearly that the cause of the problem may be that some files have been replaced after the blog is installed due to migration or backup repair. The possible cause is that the form action is not assigned a value due to an error in reading cookies.

Solution:

1. find and use NotePad to open the root directory login. asp page

2. Run the following code:

If (GetCookie ("username") {document. getElementById ("edtUserName "). value = unescape (GetCookie ("username")}; document. getElementById ("btnPost "). onclick = function () {var strUserName = document. getElementById ("edtUserName "). value; var strPassWord = document. getElementById ("edtPassWord "). value; var strSaveDate = document. getElementById ("edtSaveDate "). value if (strUserName = "") | (strPassWord = "") {alert (""); ret Urn false;} strUserName = escape (strUserName); strPassWord = MD5 (strPassWord); SetCookie ("username", strUserName, strSaveDate); SetCookie ("password", strPassWord, strSaveDate ); document. getElementById ("frmLogin "). action = "cmd. asp? Act = verify "}

Replace:

Document. getElementById ("btnPost "). onclick = function () {var strUserName = document. getElementById ("edtUserName "). value; var strPassWord = document. getElementById ("edtPassWord "). value; var strSaveDate = document. getElementById ("edtSaveDate "). value; if (strUserName = "") | (strPassWord = "") {alert (""); return false;} strUserName = escape (strUserName ); strPassWord = MD5 (strPassWord); SetCookie ("username", strUser Name, strSaveDate); SetCookie ("password", strPassWord, strSaveDate); document. getElementById ("frmLogin"). action = "cmd. asp? Act = verify ";} if (GetCookie (" username ") {document. getElementById (" edtUserName "). value = unescape (GetCookie (" username "));}

The changed code is added with a ";", as follows:

Var strSaveDate = document. getElementById ("edtSaveDate"). value

Document. getElementById ("frmLogin"). action = "cmd. asp? Act = verify"

After moving a ";", the statement becomes as follows:

If (GetCookie ("username") {document. getElementById ("edtUserName"). value = unescape (GetCookie ("username "));}

And the above Code has changed its position.

3. Save and upload the space to replace the original page. Then test Ing...

Friends who cannot log on must be aware of the above phenomenon. Not all reasons for not logging on can be solved! It took me more than half a day to help you.

The code before modification is as follows:

 

The modified code is as follows:

  

 

 

The article was originally published on www.ok365ok.com, a blog published by dongge Alibaba. For more information, see the source. O (distinct _ distinct) O ~

Related Article

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.