Dreamweaver MX 2004 to Do ASP program (5) Landing System implementation

Source: Internet
Author: User
Tags reset variable window dreamweaver
dreamweaver| Program

  1. In the site of the right key to create a new file login.asp used to do login page; Similarly, previously had built and database connection file conn.asp. So in the panel "application"----"database" label inside automatically have "conn".

2. As with the registration page, you need to go to the "+" Recordset under the Bindings tab of the application panel. Click " Test " When you have finished selecting in the pop-up window to see the relevant records in the current database that meet the SQL conditions.

  3. A form form is made on the login page, and the input text box is properly named.

Form-related code:

<form name= "Form1" method= "Post" action= "" >
<p>
User name:
<input name= "user" type= "text" id= "user" >
</p>
<p> Password:
<input name= "Pass" type= "text" id= "pass" >
</p>
<p>
<input type= "Submit" name= "Submission" value= "submitted" >
<input type= "reset" name= "Submit2" value= "reset" >
</p>
</form>

4. The form label in the dot selects the entire sheet.

5. Select "+"----"User authentication"----"Log on user" in the "Server Behavior" in the Applications panel.

6. Pop-up dialog box to make specific settings. Get input from form means to select a specific Form1 form from this ASP page, as well as the required user name and password fields in the form.

Connection verification indicates that connection settings are made through conn files and database tables. Select the user table, which lists the names of users and passwords in the database for a specific username and password field. It is obvious that the contents of the fields in the library and the content submitted in the form are validated compared to the connection.

"Login successful, go to" loginok.asp, the page is a permission page, only when the login is completely correct to enter. Otherwise login failed, go to loginbad.html.

7. After the determination, the Login.asp is basically completed. 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. Save the file, create a new loginok.asp file, this 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. Pop-up stage Variable dialog box, according to the 7th step of the code display, the name input mm_username sentence can be. Represents a direct reference to the session ("mm_username") = Mm_valusername.

10. Select the established "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. Again for loginok.asp to do permissions, 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, according to " username and password " to limit, refused to jump to "loginbad.html."

13. The basic setup of the loginok.asp is complete. 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.

The specific method of production is no longer described in detail! It's very simple!



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.