dreamweaver| Program
1. Set up the first page search.asp, its main role is to find the password of a friend to enter their user name, very simple page: a name text input box, and a Submit button.
2.search.asp Select Form tag, in the corresponding property box, "Action" fill in Search1.asp, "method" using post.
3. Save Search.asp, create a new search1.asp inside the site, and open it. This page has two functions:
1, to determine the previous page, that is, search.asp fill in the name of the database exists.
2, there is no error should be prompted, the existence should be the user's problem (question) field content display. How to achieve it concretely?
The database on the 4.search1.asp has been well connected. In the old way, first bind the recordset (Application panel--Under the Bindings tab, "+" "Recordset (Query)"). In the pop-up "Recordset" will be well set. The main thing is "filter", select "Name" = "form variable" "name". It means that to display the contents of the field name in a database table, there is a condition: The Name form content written from the previous page (search.asp) is equal to the field name value in the library.
5. Switching to "advanced" can be seen automatically generated SQL code, which has Requeset.form ("name"), meaning that the 1.asp text box entered the value received.
6. In the search1.asp page of the user does not exist in the prompt language "This user has not registered, so you do not need to find the password." "
Line break and then the statement in which the user exists. But at the same time also pay attention to the problem of the password display, as well as the answer to a text box.
7. Select search1.asp Form label, the action in the property panel to fill in the search2.asp, the method uses post. Search2.asp is mainly used to determine whether the problem and the answer is consistent, if the match will display the correct password. Attention! Is the question and the answer together. And we are only the answer can pass through, then our problem how to spread to search2.asp?
8. After the "Your password question is:" Insert the cursor and then select "Question" from the "Recordset" in "binding" or drag it directly into the page. Attention! This is also only displayed to the user password problem, it is not possible to pass this information past. How can that be?
9. We use "hidden fields" to transmit question values. Inserts a "hidden field".
Modify the properties of the hidden fields: "Hide Area" name is called "Question" bar, "value" click on the Lightning icon behind, pop-up dialog box select "Question". The assignment to the hidden field question has been completed and can also be passed.
10. The rest is to strictly separate the two parts of the search1.asp. Select "This user has not yet registered, so you do not need to find the password." "The text of this paragraph. The application panel "server behavior" + "show area" record is blank displays the area. In the pop-up dialog box, select the Recordset1 you just created. The meaning is obvious: if the recordset that satisfies the SQL language query is not found, the line error prompt is displayed.
11. Similarly, select Form forms, the Application panel server behavior "+" show area "record is not empty, display the area." In the pop-up dialog box, select the Recordset1 you just created. The meaning is also clear: if there is a recordset that satisfies the SQL language query, the question and answer writing box is displayed. The final effect page should read as follows:
Finally, the search1.asp is finished. In summary, this page mainly plays a role in the connecting link. First to determine if there is no this user, if there is, and the password problem displayed, and to be able to transfer to the next page search2.asp
12. The search2.asp is going to judge the password problem that search1.asp over and whether the answer is consistent with the database. Also has two function: does not match, the explanation password answer is wrong, returns the previous page to come again! Match, that is to give people the code, hehe. But with the experience of doing search1.asp, do search2.asp is not a piece of cake!
13. Save Search1.asp, create a new search2.asp at the site and open it. The usual, bound recordset (application panel--Under the Bindings tab "+" "Recordset (Query)"). It's worth paying attention to in the pop-up recordset. Filter, select "Question" = "form variable" "Question"
14. But have you noticed that we are going to send two values to search2.asp to accept, but now only one to choose from. So what should we do? Switch to the related code for advanced SQL. We're going to add it slightly. SQL structure Query language will be a little, the ability to imitate a little stronger, hehe came over! "Variable" adds a "Mmanswer", "Run value" of course is "Request.Form" ("Answer") "and then add the SQL language and answer = ' mmanswer ' read the meaning of SQL to understand: must require question and answer match the values of the two fields in the database table.
15, then like to do search1.asp-like quick design search2.asp, the page written on the letter does not match the statement "Your question is not the answer, or go back and try again?" "And when selected, the same is the application panel server behavior" + "show area" record is empty show area.
Then there is the match, "Your password is:" After, from the "Binding" "Recordset" select "PWD" insert or directly dragged into the page;
And also select this section, the Application panel server behavior "+ Show area" record is not empty displays the area.
The whole process of production completed! You can test it yourself!