Some friends may be wondering, what is the role of setting a default content document? Careful friends will find that when browsing the homepage of some large websites, just use its first-level domain name. There is no need to specify the file name of the request page. This is why the default content document is set, and its function is to browse A default document is served to the browser when the name of the document is not specified in the browser request. For a more detailed explanation, click "Help" in Figure 3. The reason for this step is that there is no index.asp in the default content page of the website, which is not in line with Chinese people's habits.
2. Database design
First imagine, what content should be saved in a fully functional guestbook? Visitor name (Name), visitor homepage (Homepage), visitor QQ (QQ), visitor mailbox (Email), visitor image (ICON), visitor IP (IP), message content (Content), message time (Date) --- -This is information about the visitor. What if the owner wants to reply to the message? Okay, plus the reply (Reply) and the reply time (RDate), well... think about it again, have you missed anything? By the way, there is also the owner's management account: username (Username) and password (Password).
To save so much information, how should the database be designed? Visitors' messages are constantly increasing, but the owner's management account is fixed. Therefore, two tables should be separated, one to save all the visitors' messages and the visitor's profile information, and the other to save the owner's management account. OK, now you can start designing the database. Open the ACCESS software (available in Microsoft Office software) and create a new blank database. ACCESS will prompt you to save the database first and locate the folder where your guestbook is located (the author created a guestbook folder in the root directory of the site). Save as data.mdb:
Then double-click "Create table using designer", as shown below when completed:
In order to optimize the database, some fields need to be set:
ID: Set as the primary key to determine the uniqueness of the data to ensure that the corresponding record can be accurately located during management Name: The field size is set to 15 (few people have such long names, right?)
Email: field size is 20 (very few email addresses are longer than this number)
ICON: The field size is 6 (you will understand why it is set so small after reading the following tutorial)
IP: field size is 15 (can be calculated as four three-digit numbers plus three decimal points)
Homepage: The field size is 30 (many friends are still using second-level or even third-level domain names, so relax a little)
Date: The default value is Now () (use Now() to get the system time when inserting new records)
Close the table window and you will be prompted whether to save the modifications to the table. Select "Yes", then change the table name to main, and create the table admin in the same way to save the management account:
Finally, a table is needed to record the corresponding IP address. You can search this IP library online, or download it from http://x-lover.com/temp/ip.mdb, and then open the database data.mdb.
, select "Get external data>>Import" under the "File" menu, then select the database you just downloaded in the pop-up dialog box, import, select the address table, and confirm. There should now be three like this in the database data.mdb surface:
At this point, all preparations are completed.
The program is run and configured. Without further ado, let’s start our DW MX 2004 experience journey.
3. DW site definition
In the previous section, we defined the site root directory in IIS as E:Work. Now go to this directory and create a new folder and name it geustbook.
Open DW, find the "Manage Sites..." item under the "Site" menu and click on it, as shown in the figure below:
Open the "Manage Site" dialog box, click "New...", and select "Site" from the drop-down menu to define a new site:
Follow the New Site Definition Wizard step by step to define our message board site. Fill in the site name with geustbook:
Click "Next>" to proceed to the next step of background technology selection. Here we choose ASP using VBScript as script:
Click "Next>" to proceed to the next step of site folder settings. Because we are testing locally now and the gustbook folder is in E:Workguestbook, the settings are as follows:
Click "Next>" to proceed to the next step of setting the DW test URL:
Click "Next>" to continue to the next step. Because we are testing on this machine and do not require the participation of the remote server, select "No":
Click "Next>" to continue to the next step. What is displayed here is the information we just filled in. The purpose is for us to confirm. If you find something wrong, you can click "back"
A more careful friend may find that there are two labels on the site definition dialog box: "Base" and "Advanced". In fact, the purpose is the same, except that "Base" is a step-by-step wizard mode, while "Advanced" is This is an advanced mode for those who have a certain understanding of DW. Those who are interested can switch to the "Advanced" mode to have a look.