Some friends may wonder, what's the effect of setting a default content document? A careful friend should find out, when browsing the home page of some large sites with its first level domain name on the line, do not need to specify the file name of the request page, which is set the default content document, which is the role of the browser when the request does not specify the name of the document, the default document to the browser. For a more detailed explanation, you can click Help in Figure 3. This step is because the site's default content page is not index.asp, not in line with Chinese habits.
Second, database design
First of all, a full-featured message should have what content should be saved? Visitor's name (name), Visitor's homepage (homepage), visitor QQ (QQ), visitor's mailbox (email), visitor image (ICON), guest IP (IP), message contents (content), message time (date)----This is information about visitors, What if the owner wants to reply to the message? OK, plus reply (Reply) and reply time (rdate), um ... And think about what's missing? Yes, there is also the owner of the management account: User name (Username), password (Password).
To save so much information, how should the database be designed? Guest's message is increasing, and the owner's management account is fixed, so should be divided into two tables, one to keep all the visitors ' messages and visitors ' information, the other is to save the owner's management account. OK, now you can start designing the database. Open access (available in Microsoft's Office software), create a blank database, Access prompts you to save the database, navigate to the folder where your message is located (I built a guestbook folder in the root directory of the site) and save it as Data.mdb:
Then double-click "CREATE table using designer" and finish as shown:
To optimize the database, some fields need to be set:
ID: Set as primary key to determine data uniqueness to ensure accurate positioning of records in management
Name: The field size is set to 15 (few people have such a long name?). )
Email: Field size is 20 (also rarely has email address length exceeding this number)
ICON: Field size is 6 (see the following tutorial to understand why it is so small)
IP: Field size is 15 (can be calculated, four three-bit long numbers plus three decimal points)
Homepage: Field size is 30 (many friends are still using the domain name of level two or even three, so relax a bit)
Date: The default value is now () (with now () to get the system time when the new record was inserted)
Close the table window to indicate whether to save changes to the table, select Yes, and then change the table name to main, and create TABLE admin to save the admin account number:
Finally also need a record IP address table, this IP library can be searched online, or to Http://x-lover.com/temp/ip.mdb download, and then open the database Data.mdb
, select "Get External Data >> import" Under the File menu, and then in the pop-up dialog box, select the database you just downloaded, import, select the Address table, and make sure that there are now three tables in the database Data.mdb:
So far, all the preparations are complete.
Program Run configuration is finished, nonsense not to say, directly start our DW MX 2004 Experience Tour bar.
Third, the site definition of DW
In the previous section we defined the site root directory in IIS in E:\Work, and now go into this directory to create a new folder and name it Geustbook.
Open the DW and locate the "Manage Sites ..." Item under the "Site" menu, see the following figure:
Open the "Manage Site" dialog box, click "New ...", and select "Site" in the Drop-down menu to define the new site:
Follow the new Site Definition Wizard step-by-step to define our message board site. Fill in the Geustbook on the site name:
Click "Next>" to continue the next step of the background technology selection, where we choose to use VBScript as a scripting asp:
Click "Next>" to continue next to the site folder settings because we are now testing locally and the Gustbook folder is in E:\Work\guestbook, so set the following:
Click "Next>" to continue the next step to set the test URL for DW:
Click "Next>" to continue to the next step, because we do not need a remote server to participate in the native test, so select "No":
Click "Next>" to continue to the next step, here is the information we have just filled out, the purpose is to confirm that, if found to be wrong, we can point "back"
A careful friend may find that there are two tags on the site Definition dialog: "Base" and "Advanced", in fact, the use is the same, but "base" is step-by-step wizard mode, and "Advanced" is to the DW have some knowledge of the advanced mode of friends, Interested friends can switch to the "Advanced" mode to see.