Dreamweaver MX creates our guestbook (1)
Author:Eve Cole
Update Time:2009-05-31 21:07:24
Hello everyone, we meet again. :) In the previous chapters, we talked about how to use the server behavior of DW MX to operate the database and generate dynamic pages, but don't you think it's a bit confusing and not easy to understand? Yes, what we talked about earlier are individual server behaviors, and they seem to have no connection. In this chapter, we will learn how to flexibly apply the server behavior of DW MX - to create our guestbook! (Yes, it is a guestbook, which will use most of the server behaviors without writing a line of code.)
Do some preparation work first, create a few new pages and name them:
index.asp: Guestbook home page, used to display messages, etc.
new.asp: Post a new message.
rep.asp: The page used by the webmaster to reply to messages.
edit.asp: A page for editing some unhealthy message content.
del.asp: Same as above, but the method is more ruthless, delete it directly. :)
login.asp: Only the webmaster has the authority to reply, edit, delete and other operations mentioned above. The webmaster can log in and manage the guestbook through this page.
sorry.asp: The page returned when the login is incorrect.
As shown in Figure (7-1).
7-1
In terms of database, we need to use two tables, as shown in Figure (7-2). The table admin is used to store the name and password of the super user, and the table f_bbs stores the posting information. We will explain it in detail later.
7-2
Create two new fields in the admin table, named f_name and f_password, and set the data type to text respectively, as shown in Figure (7-3).
7-3
Table b_bbs is a bit troublesome, but don’t be afraid, let’s do it step by step, first look at the picture (7-4).
7-4