In the beginning of the design of an ASP site, faced with a lot of problems, in the end to how to start to make the site design fast, good, and debugging, change, transplant and convenient? Following the design of the message book as an example, talk about the design of the site.
(i) the function of the site
"Maito", first write the function of the site, for the future work has a lot of help. Now to design a message book, the function is as follows:
1, single user version. Only one administrator, everyone can leave a message, you can search the message
2, record the ip,qq of each message, avatar, name, homepage, email, message time, message content;
3, have the administrator reply function. If you have already replied, you can also change the contents of the reply. Record the time of reply;
4, record the location of the homepage, in order to quickly return to the home page.
5, custom headers and footers. Displays the specific information.
6. Save data to an Access database
7, management functions: admin login/reply/delete/change admin password/change the number of messages displayed/change the home page
(ii) Site database
General ASP site to use the database, the first design database, in use will not be for a field to query or change the design of the database. Especially for large Web sites, good database design can affect the entire site's operation. Now let's design the database of the message book:
1, database name: Lyb.mdb
2, table: A total of two tables
Table One: admin
| Field name |
Type |
Length |
Other |
Description |
| Admin_user |
Text |
15 |
Null value/PRIMARY key not allowed |
Administrator user Name |
| Admin_pass |
Text |
15 |
Null value not allowed |
Administrator password |
| Admin_http |
Text |
50 |
Can be a null value |
Home Address |
| Admin_perpage |
Digital/integral type |
Decimal number is 0 |
Table II: Main
| Field name |
Type |
Length |
Other |
Description |
| user_id |
Automatic numbering |
| User_name |
Text |
15 |
is not empty |
Name |
| User_image |
Text |
30 |
is not empty |
Avatar filename |
| User_ip |
Text |
15 |
is not empty |
IP Address |
| User_oicq |
Text |
10 |
Can be empty |
QQ number |
| User_http |
Text |
50 |
Can be empty |
Home |
| User_email |
Text |
50 |
Can be empty |
Email |
| User_time |
Date |
Long Date |
Message time |
| User_ly |
Text |
255 |
is not empty |
Message content |
| User_replay |
Yes/No |
Whether to reply |
| User_rply |
Text |
255 |
Can be empty |
Reply content |
| User_rptime |
Date |
Long Date |
Reply time |
Message the database is relatively simple, if it is a large site, in the database design after repeated inspection. All field names are best to use the naming standard, after the database design is completed, it is best to print out a list like the above to facilitate the use.