Preface
"News system" seems to be the first lesson for all the friends who learn Dreamweaver UltraDev (hereinafter referred to as UD !!! We have another news system today! Everyone will do it! Today, I want to tell you how to generate a static *. htm page News system!
What is the so-called static page News system? Let's take a look at the Sina news page at http://news.sina.com.cn/c/2002-05-23/1558584195.html. How does this address end with *. htm? What we do with ASP, is not all like http://news.sina.com/news.asp? Is the ID = 242553? Are Sina News manually added ?" A friend in the forum asked. The answer is certainly not (if so, Sina's background management personnel should be short in typing, haha )! In fact, the news is still added in the form of a database, but the FSO ("FileSystemObject" is what we call the File Access component) is used at the same time to write the database content as static *. what are the benefits of doing so on the htm page? When the website traffic is too large, our ASP is too busy. A large number of database queries will make our servers unable to afford it. If all the requests are static pages, the server load is greatly reduced, and the speed is certainly faster!
Well, I'm not a little interested. Let's talk about the program requirements and key points of production:
1. Server system: win2000 IIS5.0 or IIS4.0 (strongly recommended );
2. Your system or remote server must support FSO (FileSystemObject file read/write );
3. In program creation, we should learn to separate the code produced by UD (which also allows us to understand the code that UD is "horrible );
4. Some hand-written code, combined with the UD code, should be noted by friends who have never opened a code window );
OK! Ready! Let's get started!
Part 1: Add News
1. Page list. In this simple news system, we need to use the following page: add. asp (add news), browse. asp (news browsing), del. asp (delete news), example_updata.asp (modify template), save.asp(save news], OK .htm (success page), updata. asp (modify news), updata_save.asp (save changes)
2. Prepare the database. Create a database (Access2000 is used here) File: asp2htm. mdb, create two tables: T_News, T_Example, as shown in the figure:
<