Rookie learns to use Dreamweaver to do ASP2

Source: Internet
Author: User
Tags add filter empty final sql variable dreamweaver access
Dreamweaver

7, after the determination, the login.asp basically completes. Switch to Login.asp's code window, note! The user's local variable session has been generated: session ("mm_username" = mm_valusername). This variable can be used throughout the station.

8, a new loginok.asp, which is a protection page, only when the user password correctly logged in will not enter. Otherwise jump to loginbad.html (login failed, possibly because of a user name or password wrong.) To open loginok.asp, application---bind---stage variable

9, the pop-up Stage Variable dialog box, according to the 7th step of the code display, the name input mm_username sentence can be.

10, select the set up "Mm_username", press the "Insert" button or drag it into the page. Allows different users to dynamically display their corresponding names when they enter.

11, and then for the loginok.asp do permission limit, meaning you can know http://localhost/newgn/loginok.asp, but you simply input in the address bar is absolutely not in, or the user password is not correct can not enter. How to achieve this effect?

The server behavior---Authentication---"Restrict access to pages" is OK.

12, by "username and password" to limit, refused to jump to "loginbad.html"

13, about loginok.asp Basic set up, feeling is still very troublesome, but by the steps will be a lot better, hehe.

Now, there's a loginbad.html to try again. Very simple, Login failed to jump to the page, illegal login also jumped to this page, the content is very simple.

1, have you registered? Check it out if you don't have it!

2, you are not forgetting something, return carefully fill in oh.

14, almost, debug it. Of course, start from the Login.asp, fill in the correct look.

Test:

First Use name:cnbruce,pwd:123456 .

Note that the name behind is Cnbruce

and use name:cnrose,pwd:123456 .

Note that the same is loginok.asp, but the name of the person displayed is different.

then casually knock a http://localhost/newgn/loginok.asp look, its automatic jump to loginbad.html.

Today the login system to do a good job, it will be enough for you to use the time.

Also, the front of a lot of review, until the eyes closed coherent to login system.

Hey, to tell you the truth, I've done no less than 50 times, and now it's 3 months.

That more practice ah, laying the groundwork Ah, hehe!

Next: Find the password system ...
Sixth step Search password system

1, set up the first page 1.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,1.asp Select Form tag, in the corresponding property box, "Action" fill in 2.asp, "method" using post.

3, save 1.asp, create a new 2.asp inside the site, and open it.

This page has two functions:

1, to determine whether the previous page, that is, 1.asp filled out the name in 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,2.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 that the name form content written from the previous page (1.asp) is equal to the field name value in the library.

5, actually switch to "advanced" you can see automatically generated SQL code, which has Requeset.form ("name"), meaning that the 1.asp text box entered the value received.

6, in the 2.asp page typing does not exist the user's prompt language "Hey, 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 show the password, as well as the answer to a text box.

7, select the 2.asp form label, the action in the property panel to fill 3.asp, method using Post. 3.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 reach 3.asp?

8, in the "Your password question is:" After the insertion of the cursor, and then from the "binding" in the Recordset, select "Question" insert or drag 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 field" to transfer the value of question. Insert a "hidden field" PS: is someone not inserting it? OH), the "hidden field" of the property to modify: "Hidden area" name is called "Question" bar, "value" click on the back of the Lightning icon, pop-up dialog box to select "Question." The assignment to the hidden field question has been completed and can also be passed.

10, the rest of the 2.asp is strictly separate the two parts.

Check "Hey, this user has not 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 form, the Application panel server behavior "+ Show area" record is not empty, display 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 2.asp was taken care of. In summary, this page mainly plays a role in the connecting link. First of all to determine whether there is no this user, if there is, and the password problem displayed, and to be able to transfer to the next page 3.asp

12, the 3.asp will judge the 2.asp over the password problem and 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 2.asp experience, do 3.asp is not a piece of cake!

13, save 2.asp, create a new 3.asp in 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 transmit two values to 3.asp, but now we can only select one. 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") "

Then add the SQL language and answer = ' mmanswer '

looking at the meaning of SQL is clear: you must require question and answer to match the values of the two fields in the database table.

15, and then, like doing 2.asp-like fast design 3.asp

On the page write a statement that does not match "hehe, your question answer is not this, or go back to 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.

16, save 3.asp, you are done! To Debug.

Rookie also learn DW do ASP (find password Chapter) Hot ★★★★
rookie also learn DW do ASP (find password Chapter)
[Author: Xiao Li posted from: Network Hits: 1483 update time: 2003-12-12 article entry: seize the soul erotic ]


9, we use "hidden field" to transfer the value of question. Insert a "hidden field" PS: is someone not inserting it? OH), the "hidden field" of the property to modify: "Hidden area" name is called "Question" bar, "value" click on the back of the Lightning icon, pop-up dialog box to select "Question." The assignment to the hidden field question has been completed and can also be passed.


10, the rest of the 2.asp is strictly separate the two parts.
Check "Hey, this user has not 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 form, the Application panel server behavior "+ Show area" record is not empty, display 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 2.asp was taken care of. In summary, this page mainly plays a role in the connecting link. First of all to determine whether there is no this user, if there is, and the password problem displayed, and to be able to transfer to the next page 3.asp


12, the 3.asp will judge the 2.asp over the password problem and 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 2.asp experience, do 3.asp is not a piece of cake!

13, save 2.asp, create a new 3.asp in 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 transmit two values to 3.asp, but now we can only select one. 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") "
Then add the SQL language and answer = ' mmanswer '
Looking at the meaning of SQL is clear: you must require question and answer to match the values of the two fields in the database table.

15, and then, like doing 2.asp-like fast design 3.asp
On the page write a statement that does not match "hehe, your question answer is not this, or go back to 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.

16, save 3.asp, you are done! To Debug.


Today, it's all about the relationships between pages, the use of SQL, and the display of areas based on records.

Be clear about the rationale and the logical sequence.

Seventh Step: Modify the Data article

Modify the information! First of all to sober up a little, what talent can be modified.

One, I can only modify their own; second, the administrator can modify everyone's.

So let's get a page that can modify your profile today.

The order is: first confirm is the correct login, then your own data appears, then you can modify, right.

Also remember---Rookie also learn DW do ASP. (Login system article)

This loginok.asp page is still in the bar. It doesn't matter if it's not there. Do it again as an exercise.

All right, now. Loginok.asp is mainly a personal information page, different users display different information.

This page should note: It is a protection page, to add "restricted access to the page", of course, I believe you have done.

Then there's the record, come on! Do it!

1,loginok.asp The Application Panel Bindings tab "+" Recordset.

Rookie also learn DW do ASP (modify information) Hot ★★★★
rookie also learn DW do ASP (modify information)
[Author: Xiao Li posted from: Network Hits: 1824 Update time: 2003-12-12 article entry: seize the soul erotic ]


Today is to learn how to do modify the data ASP page

Modify the information! First of all to sober up a little, what talent can be modified.
One, I can only modify their own; second, the administrator can modify everyone's.
So let's get a page that can modify your profile today.

The order is: first confirm is the correct login, then your own data appears, then you can modify, right.
Also remember---Rookie also learn DW do ASP. (Login system article)

This loginok.asp page is still in the bar. It doesn't matter if it's not there. Do it again as an exercise.

All right, now. Loginok.asp is mainly a personal information page, different users display different information.
This page should note: It is a protection page, to add "restricted access to the page", of course, I believe you have done.
Then there's the record, come on! Do it!

1,loginok.asp The Application Panel Bindings tab "+" Recordset.

2, pop-up dialog box, well set down! The main is to filter the BLOCK: "name" "=" "Stage variable" "Mm_username".

3, switching to "advanced ..." is actually generating the sql:select * from user WHERE name= ' Mmcolparam ', and Mmcolparam is a variable that is assigned the session ("Mm_username") value at run time.

Well understood, the loginok.asp is bound and the record to be displayed has one condition: just press where to find it.

Don't worry, can't find it! Because only if the session ("Mm_username") does not exist can not be found.

And if the session ("Mm_username") does not exist that means the guy is not logged in properly.

Oh, a bit like chicken and egg problem.

4, in fact, this time you just select "Application"-"Update the record form" can make our changes.

but the personal feeling, first does not use this, uses other methods equally can, and also can learn more knowledge. Why

5, below, then follow me. And let you learn to make the master Detail page.

about the Master Detail page, as the name suggests. First, a general display (main), to which interested, often come to a "details please enter."

Of course it's not very useful in this page, because the Lord comes to you with a user information.

But what if it's the admin page? A specific view of this user will be used.


6, in the pop-up dialog box, "Recordset" Recordset1, "home field" means the field information to be displayed on the main page.

Because it is the Lord, other fields that do not appear will be "-" deleted, and the Lord has only a name left.

The following connection to the details will only choose "name".

"Pass a unique key" to choose the AutoNumber ID Bar, of course, the other can also choose, but be sure to confirm that you selected in the database table must have content. For example, some people register when QQ number does not necessarily write, then you can not choose OICQ as "pass unique key"

(The so-called "pass a unique key", is the ASP passed URL parameter values.) You do not see the xxx URL is http://www.cnbruce.com/blog/showlog.asp?cat_id=27&log_id=219, that "? "What is behind the thing, cat_id is the parameter, 27 is the value, of course, not only a parameter, a number of parameters on the & connected." Of course, these things, learn the ASP know. DW do, oh, do not understand so much, but you must learn. )

Then the "detailed page name", because has not been done, of course, recommended you do not do, why? It's a mystery!

Let's name a "xiangxi.asp" first.

"Detail page field" will not change it. Good! Are you sure.

7, determined after a period of time waiting, suddenly found that DW automatically generated xingxi.asp (just the mystery where). Not only is the page content generated, the recordset is also bound, and dynamic text is added. (Really thoughtful service)

8, and then look at loginok.asp. There are a lot of things, see Eyes daze, these are mostly connected with xiangxi.asp for connection, not rubbish, no fear, hehe.

9, and then what do you do? Go back to xiangxi.asp. We need to revise the information, so I need some text to fill in. Then there is a way to die, first select the entire table, ctrl+x the table to cut. Immediately return to the Form tool section, insert the form, and Ctrl + V paste it in the Out dotted box.

10, Next, add the text box. Delete {recordset1.xxx} One after the other, leaving only an ID and name because these two do not need to be modified and cannot be modified!

For the rest, change to the corresponding text box, and note that the "text field" has the corresponding name.

add two buttons to the table by adding one row.


11, think again, those text box inside is not empty, normal change the data will also display to the original information. So, select the form. The corresponding field in the application binding recordset.

Alternatively, use the properties of the text box to set the initial value, click the Dynamic Lightning icon, and select the corresponding field in the pop-up dialog box.

12, when you are done, select form forms ... "Application"--"Server Behavior"--"+"--"update record"

13, pop-up window, general default. After the update, go to: "The old rules first write a xiugaiok.html, later to build."

14, of course, the page is not finished, to add "server behavior"-"User Authentication"-"Restricted access to the page", mainly protected, can not be easily accessible.

finally in the xiugaiok.html done, the general content: Modify success! Return to loginok.asp.

basically finished, you can debug it. Let's start with the loginok.asp. Because it is the first time to open the window, there is no login at all, so loginok.asp back to loginbad.html automatically

Go back to Login.asp and fill it all the way down

Click "Cnbruce" to modify the password "789" OK!

Then, you go back to Login.asp to see if the change password is effective!

Finally: The entire modification page is becoming more and more complex, I take steps more methods, of course, also with the main detail page to use. The main thing is that I think this is challenging for beginners, flexible use, expansion, modification, refinement, need to practice more. It is normal to have errors, you need to know and correct the wrong, only in this way, perhaps the technology will improve.



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.