Dreamweaver MX to build our message book (i)

Source: Internet
Author: User
Tags add date key log dreamweaver
Dreamweaver Everybody good, we met again. : In the previous chapters we described how to use the DW MX server behavior to manipulate the database and generate dynamic pages, but do not feel a bit messy, not very good to understand it? Yes, we were talking about individual server behavior, as if there was no connection. In this chapter, we will learn if the flexible application of DW MX server behavior-to create our message book! (yes, this is the message book, will use most of the server behavior, and do not have to write a line of code.) )

First do the preparatory work, create a few new pages, respectively, named:
Index.asp: Message home, used to display messages and so on.
New.asp: Post a new message.
Rep.asp: For webmaster reply Message page.
edit.asp: An edited page for some unhealthy message content.
Del.asp: Ditto, but the method is more ruthless, direct deletion. :)
Login.asp: Above said reply, edit, delete and so on the operation should only stationmaster have power, webmaster through this page to login management message book.
Sorry.asp: The page returned when the log is incorrect.
As shown in figure (7-1).


7-1

We need to use two tables in the database, as shown in figure (7-2). Where the table admin is used to store the name and password of the superuser, the post information stored in the table F_bbs, we will explain in detail later.


7-2

Create a new two field in table admin named F_name and F_password, with the data type set to text, as shown in figure (7-3).


7-3

Table B_bbs is a bit troublesome, but do not be afraid, let us step by step, first look at the figure (7-4).

7-4
The field ID is the key field of the message content, because it has a lot of effect, set its data type to AutoNumber, and sets it as the primary key, that is, select it, and then click the button in the red circle in Figure (7-4).
F_name for the message user's name, very simple.
F_content is stored in the message content, because the text data type can only store 255 characters, for our message content is less, so here to set it as a note, because the note this type of data can be stored up to 65,535 characters, fully enough. :)
F_OICQ for the message user's OICQ number, set with the user name.
F_email for the message user's email address, set with the user name.
F_homepage to leave the user's home address, set the same user name.
F_time for the time to submit a message, here to note that the data type to be changed to date/time, and to set a default value. As shown in figure (7-5). This now () is a VBA-built function that is used when submitting a message if the value of the field is not specified, the system populates the field with the current date's time.
F_repcontent for webmaster reply content, with message content. Note, however, that you also want to add a default value, as shown in figure (7-6). Its role is if the current message content has not yet replied to show "no reply." Note that two double quotes Oh, must be in the English input state of the only line, such as "", if the Chinese input "" will be an error.


7-5


7-6

After the database is ready, it's our turn, index.asp, which is used to show the message and some functional connections, first look at its general appearance, as shown in figure (7-7). Also remember to set up a recordset, named Guestbook.


7-7

Here I just for the sake of convenience, so there is no use of any pictures, presumably the way it is above. The most important thing is to display the name of the message, the message content and webmaster reply, the following temporary no reply is used to ensure that when there is no message content when the display, so as to ensure that no error. Then perhaps some attentive reader will ask, I have built in the above database like OICQ number and homepage address how not to see? Oh.. No need to worry, these are of course to use, see figure (7-8), this is a basic shape of the look.


7-8

How, OICQ, Mailbox, homepage, publish time come out, it seems to be quite troublesome. Do not be afraid, in fact, are very simple, just a few small server behavior, let ' s go!! Let's take it one step at a step.
Hello everyone, we have met again. : In the previous chapters we described how to use the DW MX server behavior to manipulate the database and generate dynamic pages, but do not feel a bit messy, not very good to understand it? Yes, we were talking about individual server behavior, as if there was no connection. In this chapter, we will learn if the flexible application of DW MX server behavior-to create our message book! (yes, this is the message book, will use most of the server behavior, and do not have to write a line of code.) )

First do the preparatory work, create a few new pages, respectively, named:
Index.asp: Message home, used to display messages and so on.
New.asp: Post a new message.
Rep.asp: For webmaster reply Message page.
edit.asp: An edited page for some unhealthy message content.
Del.asp: Ditto, but the method is more ruthless, direct deletion. :)
Login.asp: Above said reply, edit, delete and so on the operation should only stationmaster have power, webmaster through this page to login management message book.
Sorry.asp: The page returned when the log is incorrect.
As shown in figure (7-1).


7-1

We need to use two tables in the database, as shown in figure (7-2). Where the table admin is used to store the name and password of the superuser, the post information stored in the table F_bbs, we will explain in detail later.


7-2

Create a new two field in table admin named F_name and F_password, with the data type set to text, as shown in figure (7-3).


7-3

Table B_bbs is a bit troublesome, but do not be afraid, let us step by step, first look at the figure (7-4).

7-4
The field ID is the key field of the message content, because it has a lot of effect, set its data type to AutoNumber, and sets it as the primary key, that is, select it, and then click the button in the red circle in Figure (7-4).
F_name for the message user's name, very simple.
F_content is stored in the message content, because the text data type can only store 255 characters, for our message content is less, so here to set it as a note, because the note this type of data can be stored up to 65,535 characters, fully enough. :)
F_OICQ for the message user's OICQ number, set with the user name.
F_email for the message user's email address, set with the user name.
F_homepage to leave the user's home address, set the same user name.
F_time for the time to submit a message, here to note that the data type to be changed to date/time, and to set a default value. As shown in figure (7-5). This now () is a VBA-built function that is used when submitting a message if the value of the field is not specified, the system populates the field with the current date's time.
F_repcontent for webmaster reply content, with message content. Note, however, that you also want to add a default value, as shown in figure (7-6). Its role is if the current message content has not yet replied to show "no reply." Note that two double quotes Oh, must be in the English input state of the only line, such as "", if the Chinese input "" will be an error.


7-5


7-6

After the database is ready, it's our turn, index.asp, which is used to show the message and some functional connections, first look at its general appearance, as shown in figure (7-7). Also remember to set up a recordset, named Guestbook.


7-7

Here I just for the sake of convenience, so there is no use of any pictures, presumably the way it is above. The most important thing is to display the name of the message, the message content and webmaster reply, the following temporary no reply is used to ensure that when there is no message content when the display, so as to ensure that no error. Then perhaps some attentive reader will ask, I have built in the above database like OICQ number and homepage address how not to see? Oh.. No need to worry, these are of course to use, see figure (7-8), this is a basic shape of the look.


7-8

How, OICQ, Mailbox, homepage, publish time come out, it seems to be quite troublesome. Do not be afraid, in fact, are very simple, just a few small server behavior, let ' s go!! Let's take it one step at a step.


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.