DREAMWEAVERMX to create a message book (d)

Source: Internet
Author: User
Dreamweaver now to do is to increase the message page, new.asp. The principle is to add data to our previously designed database, which we do not detail here, as shown in figure (7-36).



7-36


Remember to define it to submit data and then go to the index.asp home page Oh. In order to prevent it from going wrong, we have to use an action on it, but this time do not use the server behavior, the use of DW MX with the behavior on the line. After the form form is selected, Design-->behaviors-->validate form (design--> behavior--> validate the form), as shown in figure (7-37).



7-37

Remember to mark the required field for F_name and f_content, and the acceptable type of F_OICQ is changed to number,f_email acceptable type to email address.

As for edit.asp (Edit page), rep.asp (Reply page) and del.asp (delete page) then simply accept the previous values we passed to display the corresponding data, and then use the Updata Recordt and delete record server behavior. Here we are not detailed in detail, the effect as shown in the figure (7-38,7-39,7-40).



7-38
This is the Edit.asp page, which is the same as before when you set up the recordset, but remember to apply the move to specific the record server behavior to find the corresponding recordset. There are the above form of the problem and index.asp the same, but to display the user name, user comments and webmaster reply to the text box, and the corresponding database fields dragged into the text box, the last application updata Recordt server behavior, After you define the updated data, you can return to the Index.asp page. There is also a point to note that the entire large form can be placed in the form to be effective.



7-39

This is del.asp page, also want to create a form oh, but do not have to change the name to a text box, because just delete the data, the important is the move to specific the record server row and delete the record server behavior, Finally define the deletion and go to the index.asp page.



7-40

This is the rep.asp page, this page and the above edit.asp page is similar to the use of the Updata Recordt server behavior, but the difference is that it only updated a field content, ditto to use move to specific the record server behavior, Change the webmaster reply to a text box so that the super user can enter the content.

OK, just a little bit, and try hard again Ah!!!

We want to consider a problem here, how to let the management authority of the Super User management message? That is, you can edit, delete, reply, and so on. Here is the login, this is a server behavior we have not contacted before, log in user server behavior. Again, it's easy to learn. :)

Open the Login.asp page, create the form, table, text box, and name the above text box F_name, and the following name is F_password and change its type to password, as shown in figure (7-41).



7-41

After doing all this, use Application-->user authentication-->log in user (application--> user authentication--> user login), as shown in figure (7-42).



7-42
A dialog box appears as shown in figure (7-43) after clicking.



7-43

Get Input Form form: In this Drop-down list, choose which form to accept the submission, we have only one form, so no choice.
Username Field: Select the text box for the user name here. We have just defined the username of the text box named F_name, so here also select F_name.
Password Field: Select the text box for the user's password here, ditto.
Validate using Connection: Here you choose which database connection to use.
Table: To use which of the tables in the database. Notice here that we're going to use the admin table here, although we used to use F_bbs tables.
Username Column: Select the field where the user name is mapped, and select the F_name field in the database.
Password Column: Select the field that the user's password is mapped to, ditto.
If Login succeeds, go to: If you pass the verification to which page, here we define return home index.asp.
If Login fails, go to: if not validated to which page, here we define return to sorry.asp.
Restrict Access Based on: Because we want to restrict access to some pages, such as editing and deleting, so we need to use this. In the following type select username and Password, which is the username and password.

Click OK to complete the settings for this page.

Now we have to go back to a head, our edit,asp,del.asp,rep.asp are not let others casually access, here is to use the page protection of the server behavior. Application-->server behaviors-->user authentication-->restrict Access to Pags (application--> server behavior--> user authentication- > page data protection), as shown in figure (7-45).



7-45
Click to appear in the dialog box shown in figure (7-46).



7-46

Restrict ased on: The type of page protection where we choose username and password (username and password).
If Access Denied, go to: If illegal access, then to which page, where we choose to let illegal access to the Login.asp (Landing page).

Need to protect the page has edit.asp, del.asp, rep,asp, each page settings are the same, remember to set OH.

As for the final sorry.asp page, it is a simple page, as shown in figure (7-47). In this "here" plus a connection to the Login.asp page.



7-47


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.