Website design and production instructions
Source: Shangpin China |
Type: website encyclopedia |
Date: June 5, 2012
1. Introduction The early dynamic web pages mainly used CGI technology. Because of the difficulties in programming, low efficiency and complex modification, they have always been the patents of professional programmers. The emergence of ASP has changed this situation. Active Server Pages (ASP) is a combination of HTML (Hypertext Markup Language), Script (Script) and CGI (Common Gateway Interface) developed by Microsoft. Since the advent of ASP, thousands of ASP websites have been born in INTERNET every day. It is easy to learn, but powerful. It is loved by more and more people. The topic I chose for this graduation project is: using ASP design school website design - Nanbu Fuhu Middle School website. The purpose is to provide a platform for people to understand our school through the planning and design of the website, and shorten the distance between education and society. It enables people to easily and quickly obtain various information of the school without leaving home, which shows the demeanor of the school and teachers. At the same time, through this platform, the school can timely understand the suggestions and opinions of the society on our school, so that our school can correct in time in the future work. The planning and design of the website, from system research, system analysis, system design to system implementation, developed this complete system under the guidance of software engineering ideas, and improved my ability to combine professional knowledge with practice. 2. System design 2.1 Development design idea The development and design idea of the system: Try to use the existing software and hardware environment of the school and the advanced Website production System development scheme, so as to make full use of the existing resources of the school and improve the system development level and application effect. The system adopts modular programming method, which not only facilitates various combinations of system functions, but also facilitates the supplement and maintenance of technical maintenance personnel who have not participated in the development. The system should have the database maintenance function to add, delete, and modify data in time according to the needs of school information. 2.2 Selection of development and operation environment Development tools: FLASH5.0, Adobe Photoshop 6.0, Dreamweaver UltraDev 4. Server side running environment: Windows2000+IIS. Client running environment: Windows9x, Windows2000. 2.3 System function analysis The system function analysis is completed on the basis of the overall task of system development. The main functions that the station needs to complete are: News article release: introduction of school news, education and scientific research, famous schools and teachers, student parks, enrollment information, etc. Message system: provide online messages for visitors, so that the school can get social feedback in time, so as to communicate and exchange with the society. Online survey system: This website provides a column for online survey of hot issues in education and schools. Visitors can vote on behalf of themselves on hot issues through online survey. Flow statistics system: the station can make statistics on the flow from many aspects. It includes the number of opening days, the total number of views, the total number of views of the current day, the total number of views of the previous day, the total number of views of this month, the total number of views of last month, and the average total number of views. 2.4 System function module design On the basis of system function analysis, the system function module diagram as shown in the figure is obtained. Nanbu Fuhu Middle School Website Front Desk News article column interactive column online survey traffic statistics Front desk news column School News Browsing Education Research Browsing Famous Schools Teachers Browsing Student Gardens Browsing Enrollment Information Browsing In addition, parents' channel and students' channel are designed to further realize home school connection. In the parent channel, sub columns such as teaching announcement, school attendance record, parent message, parent appointment, family education, etc. are designed. In the student channel, sub columns such as college admission information, college entrance examination topics, college entrance examination question bank, school opening report, student questions, student opinions, etc. are designed. The three sub columns of parents' messages, students' questions and students' opinions in the parents' channel are designed to reflect the interaction and timely communication among parents, students and schools. It is more convenient for students and parents to express their opinions on educational resources. In order to provide parents, students, teachers and any other visitors with access to the school's educational resources, a resource download column has also been designed. The resource download column includes four sub columns: software download, test paper download, teaching plan download and table download. News article background management News background management Education background management Famous teacher background management Student background management Enrollment background management System Functional Structure Diagram I will briefly describe the overall design of each module below. 1. News article module News articles are the focus of this website. As a media, the website should be able to provide enough information that users are interested in. The website of Fuhu Middle School in Nanbu County serves as a window for the school. In order to meet the desire of the society to understand the school information, the news articles on this website mainly include five columns. They are: school news, education and scientific research, famous schools and teachers, student parks, enrollment information, etc. The overall design of the news article module is divided into foreground browsing and background management sub modules. Visitors can browse various information such as news articles on this website by clicking on the front desk. These information include: school news bulletin information, education and research information, various information about famous schools and teachers, student garden information, school enrollment related information, etc. This background management sub module completes the operations of adding information, editing information, and deleting information that can only be operated by the background administrator for the five columns in the school news article publishing sub module. The above columns are designed to satisfy any website visitor. In order to meet the needs of parents and students in two specific categories of visitors, parents channel and student channel are specially set up. According to the needs of parents, the column information of parents channel includes teaching announcements, school attendance records, parents' messages, parents' appointments, and family education. The teaching announcement includes sub columns such as assignment announcement and examination announcement. Parents' message is an interactive column, which is dedicated to parents' inquiry and opinions on school policies and teaching progress. The information of student channel columns is mainly related to students, such as college enrollment information, college entrance examination question bank, etc. 2. Message module Many visitors have many suggestions and opinions on the development and current situation of the school. As the window of the school, the website needs to provide a platform for visitors to speak. For this reason, the website design and planning has a message module, This module is also divided into browsing foreground speech and browsing sub module and background administrator deleting and modifying speech sub module. 3. Online survey module This website provides online survey columns for some social hotspots, and visitors can vote for their own opinions on social hotspots on the website. In this way, public opinion can be integrated to get education and other hot spots to determine the future direction of development. 4. Flow statistics module As an administrator, you should know the traffic of this website in real time. The data of traffic statistics include: the number of days the website opened, the total number of views, the number of views on the current day, the number of views yesterday, the number of views this month, the number of views last month, the average number of visits, etc. If there is no traffic on a website, it means that the columns on the website are not attractive. As the administrator, the school can know whether the traffic changes after the website opens a new column through the traffic. 5. Resource download module If a school website can provide browsing access to school information resources, it is not enough to provide family, school, teacher, student interaction and exchange columns. The school's various examination papers and other educational resources are also very much wanted by visitors, so a download module of educational resources has been designed. Downloaded resources include lesson plans, test papers, other software, etc. 3. Design of background database Through the analysis and design of the above functional modules, we can know that the design of this website needs to involve the design of the background database. In the development of database application system, the structure design of database is a very important problem. The quality of the database structure design will directly affect the efficiency of the application system and the implementation effect. A good database structure will reduce the storage capacity of the database, the integrity and consistency of the data are relatively high, the system has a fast response speed, and simplify the implementation of applications based on this database. At the beginning of the design of the database system, we should try to consider all aspects, especially the needs of users, to avoid wasting unnecessary manpower and material resources. 3.1 Database demand analysis Database requirement analysis is the first stage of database structure design, which is a very important stage. In this stage, it is mainly to collect basic data, data structure and determine the data processing flow to form a detailed data dictionary, which will lay the foundation for further design in the future. On the basis of careful investigation of the operation process of this website, we get the data flow processed by this website as shown in the figure. administrators Sign in Enter login information Visitors log in to the website Browsing of various information in the website background management DB database Management direction Various information background management Password management It can be seen from the above data flow that the administrator can manage the website by logging in to the website and entering the correct user name and password. After entering the management status, you can select the items to be managed, which can be the modification of system setting information, including the administrator password, or the backstage management of other information in various databases of this website, including the management of school profile, school news, education research, famous teachers, student parks, enrollment information, recruitment information, etc. The content of management is divided into: adding, modifying, deleting, approving and other operations of information. Visitors can enter the school website in the browser to log in to the website, and browse various relevant information by clicking the website link. These information are displayed in the foreground by calling the relevant information in the background database. For the data structure of this website, the following data items and data structures can be obtained through the above analysis of the content and data relationship of the data process of this website: ● News information: news category number, title, column, article source, article author, content, release time, clicks, keywords, status, etc. ● News category: category number, category alias. ● Column of news: column number, category number, column name. ● Administrator information: user name, password, etc. ● Message information: user name, e-mail address, region, home page address, OICQ number, ICQ number, avatar, message content, etc. ● Message background administrator information: user name, password, etc. ● Online survey information: subject number, subject name, main point 1, main point 2, main point 3, main point 4, number of votes for point 1, number of votes for point 2, number of votes for point 3, number of votes for point 4. ● Traffic statistics: total traffic, today's traffic, yesterday's traffic, this month's traffic, last month's traffic, opening date, and last IP access. ● Resource information: each resource information includes two aspects: text introduction information and resource storage information. Text introduction information, like news information, is a kind of news information, so here we focus on resource storage information. After uploading resources, the storage information includes three attribute items: resource number, information number, and storage path. The message number corresponds to the number of the resource text message in the news message. Storage path Storage path and file name of uploaded resources. With the above data structure, data item and data flow, the following database design can be carried out. 3.2 Database conceptual structure design This design stage is to design various entities that can meet the website design requirements on the basis of demand analysis, and determine the relationship between them, laying the foundation for the following logical structure design. According to the data items and data structures planned by the above design, the entities obtained by this website include news entities, news category entities, news column entities, administrator entities, message information entities, online survey information entities, traffic statistics entities, etc. The following details the main entities of the system and their relationships. 1: E-R diagram of information entity: Information entity Message Number Subject Category No Column No 2: E-R Diagram of Information Category Entity: Information Category Entity Category No. Category Name 3: Entity E-R diagram of information column: Information column entity Column No. Category No. Column Name 4: Administrator Entity E-R Diagram: Administrator Entity User No. User name User password 5: Resource Entity Attribute Map Resource entity Resource number Information number Resource path 6: The E-R diagram of main entities and relationships between entities is shown in the figure. Information entity 1 belongs to category 1 entity Management management Column entity management administrator entity 3.3 Design of database logical structure We need to transform the above database conceptual structure into the actual data model supported by ACCESS2000 database system, that is, the logical structure of the database. On the basis of the above entities and their relationships, we can form tables in the database and the relationships between various tables. According to the conclusions drawn in the analysis phase, combined with the needs of the website for the storage of relevant data, it is more convenient to realize all the expected functions of the website. Now, the system is designed into five database tables, and the field name, type and width of each table are designed as follows: The design results of each table in the database are shown in Table 3-1 to Table 3-2. Each table corresponds to a table in the database. Table 3-1 is the news information table. This table is used to record and store various information related to the news information of this website: Field Name Type Width Description Newsid automatic number long integer news number Typeid Numeric decimal category number Borderid Number Decimal Column Number Topic Text80 Topic Content Remarks News content Time Date 8 Release Time Hits number decimal reading times Keys Notes Notes Keywords Img text 50 related pictures Nfrom text 100 source Modify Text30 Editor Audit Whether the numeric long integer is approved Auditor text 50 Reviewer Writer Text50 Author Imgsize Digital Decimal Picture Size 3-2: News category table: This table is used to store the category names of news information on this website. Field Name Type Width Description Typeid Automatic numbering Long integer category number Typename Text50 Category name 3-3: News column list: This table is used to store the category names of news information on this website. Field Name Type Width Description Borderid Automatic Numbering Long Integer Category Number Typeid Automatic numbering Long integer category number Bodername Text50 Category Name 3-4: Administrator Information Table: This table is used to store the administrator information of this website. Field Name Type Width Description Userid Automatic numbering Long integer user number Name Text15 User name Pwd Text14 Password 3-5: Resource Information Table: This table is used to store the administrator information of this website. Field Name Type Width Description ID Automatic number Long integer resource number Information number corresponding to Newsid text 15 Lujin Text14 Resource Storage Path The above is a brief description of the design of the library table structure of this system. 4. Implementation of website After completing the design of the above background database, we can convert the technical design to the physical implementation of the functional modules logically designed in the previous system analysis stage, which is the implementation stage of system construction. Therefore, the achievement of the website will be the crystallization of the system analysis and design phase. 4.1: Install website design related software: The website design requires FLASH8.0, Adobe Photoshop 8.0, Dreamweaver and other software related to web design. FLASH8.0 mainly completes the design and processing of relevant animations in web pages. Adobe Photoshop 8.0 is mainly used to complete the size, format conversion and effect processing of relevant pictures in the web page. Dreamweaver mainly completes the layout and layout design of web pages. 4.2 Establish the operation environment of Asp The current popular Windows operating platforms include Windows XP. The following is a brief introduction to establishing the Asp running environment on the XP operating platform. Establish the running environment of Asp on Windows 2000/XP The environment running Asp on Windows 2000/XP is also IIS. If Windows 2000 Server is installed, IIS 5.1 will be installed as a default option. If you are using Windows 2000/XP Professional Edition, you need to use the Add/Remove Programs control panel to install IIS and its components. 4.3 Design of homepage When visitors enter the website, the first thing they open is the homepage of the school website. The homepage design should be beautiful and provide enough links so that visitors can navigate to the information pages they care about through the links. The following is the running interface of the home page: The layout structure of the page is π type. To be specific, there are log images and navigation bars on the page. The log picture shows the theme of the website: the website of Fuhu Middle School in Nanbu County. The navigation bar divides the columns of this website into the columns of school overview, school news, education and research, famous teachers of famous schools, student parks, enrollment information, talent recruitment, president's mailbox, online messages, etc. These navigation columns are designed with corresponding text links. Click these text links to enter the corresponding page. Open the professional web design tool Dreamweaver UltraDev 4. 1: Create a new web page file and save it as index.asp. Then set the page properties. The title of the property page is Fuhu Middle School in Nanbu County. Background pattern: img/bg_line.gif. Define the presentation style of tables, cells, text and links in the page. The statements defined on this page are as follows: <style> body {margin:0px;font-size:12px;overflow-x:hidden;overflow-y:scroll;color:#666666;LINE-HEIGHT: 160%} table {font-size:12px;LINE-HEIGHT: 160%} td {font-size:12px;} .txt {font-size:12px;border-width:0px;border-bottom:1px solid #000000;background-color:#def1f7;position:relative;top:0px;left:5px;padding-bottom:0px;color:#a0a0a0;} a:link.list {font-size:12px;color:#666666;text-decoration:none;} a:visited.list {color:#666666;text-decoration:none;} a:hover.list {color:#333333;text-decoration:underline;} a:link.more {font-size:12px;color:#666666;text-decoration:none;} a:visited.more {color:#666666;text-decoration:none;} a:hover.more {color:#333333;text-decoration:underline;} img {border:0px;} </style> Use the Layout Table tool to set the table layout of the web page. You can then add cells to the table. You can add text and insert pictures in cells after you set their respective properties using the table property panel and the cell property panel. The webpage with layout design is as follows: Code design: in order to display school news, education and scientific research, famous schools and teachers, student parks and other text information on the home page, as well as to facilitate management. Instead of designing static text information in each column, Java script is embedded. The data source of the script comes from an asp file connected to the database: new. asp. The following four java script statements corresponding to the school news, education and scientific research, famous schools and teachers, and student garden are given: 1:<script language="javascript" src="news.asp?typeid=10&n=10?m=14"></script> 2:<script language="javascript" src="news.asp?typeid=11&n=10?m=14"></script> 3:<script language="javascript" src="news.asp?typeid=12&n=10?m=14"></script> 4:<script language="javascript" src="news.asp?typeid=13&n=10?m=14"></script> By comparing these four script statements, it can be found that the script calls the same asp file, but only a different typeid. In the design of the database, we know that this parameter is the category number of the news. Since these four different types of information are stored in the news table in the database, the classification of information can be achieved by setting the category number. Here typeid=10 corresponds to school news, typeid=11 corresponds to education and research, typeid=12 corresponds to famous teachers in famous schools, and typeid=13 corresponds to student parks. Let's briefly introduce the code of news.asp file: Get the parameters passed above in the news.asp file first. It is realized by the following statement: typeid=request("typeid") n=trim(request("n")) Here, n is the parameter of how many records in the query table meet the conditions. Then query the last n qualified records from the news table of the database through the following statement: sql="select top " & n & " * from news where typeid=" & cstr(typeid) & " and audit=1 order by newsid DESC" The audit here indicates the information that has passed the audit. The last information is displayed in reverse order of newsid number. In addition, there is an include file at the beginning of the file: <!--# include file="function/DBOpen.asp"--> This file is used to link the database. Include files at the end of the file: <!--# include file="function/DBclose.asp"--> This include file is used to shut down the database. 4.4 Shownews.asp design for displaying news and downloading files A large amount of news information on the home page is displayed by linking to the shownews.asp file. For example, click any news in the school newsletter on the home page to link to the page and display the details of the news. The following is the page displayed after the news of "remarkable teaching achievements of Fuhu Middle School in Nanbu County" in the school newsletter. The link sentence of the news is: shownews.asp? newsid=413 The passed parameter newsid here is used to pass the number of the displayed news. The design process of this page starts with the layout design in Dreamweaver UltraDev 4. The design interface is shown as follows: Comparing the actual running interface with the design interface, we can see that the design of the navigation bar is not given here directly, but a js file is called through a script. The advantage of this design is that it can share the navigation js file with other pages. The statement to call the script is as follows: <script language="JavaScript" src="newsbar.js"></script> The statement of the newsbar.js file is as follows: document.writeln("<table width=100% border=0 cellspacing=0 cellpadding=0>"); document.writeln(" <tr align=center>"); Document. writeln ("<td width=15%><a href=more. asp? Typeid=9>School Overview</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=10>School News</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=11>educational research</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=12>famous teachers of famous schools</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=13>Student Garden</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=14>Enrollment Information</a></td>"); Document. writeln ("<td width=14%><a href=more. asp? Typeid=15>Recruitment of Talents</a></td>"); document.writeln(" </tr>"); document.writeln("</table>"); In addition, by comparing the shownews.asp file, we can see that the news title and news content on this page also call other statements and scripts. The news title calls the asp script:<%=rs ("topic")%>is used to display the topic field value in the record set. This field is the field value in the query record set realized through the sql statement. The related SQL query statements are as follows: rs.open "select * from news where newsid=" & cstr(request("newsid")),conn,1,1 This statement queries the records whose newsid number is equal to the passed parameter newsid from the news table. The content display of news is also similar to the theme display of news, which will not be explained here. Finally, here is the implementation technology of the news related to this news displayed on this page: First, let's start with the fields in the news table in the database. There is a keys field in the news table. We can use the SQL statement to query the records with keys values similar to the news keywords in the news table to get relevant information. The Sql statement is as follows: rsc.open "select top " & aboutnews & " * from news where keys like '%" & trim(rs("keys")) & "%' and newsid<>" & cstr(rs("newsid")) & " and audit=1 order by ntime DESC",conn,1,1 In addition to displaying news details, the shownews.asp file is also shared with the detailed page of downloaded resources. In order to display general details without the word "download", you can use the if statement to judge the progress of the variable xz. If the xz variable is equal to 1, it indicates that it is the detailed page of resource download. At this time, the word "download" is displayed. The download link comes from the corresponding path of the resource in the resource table. 4.5 More news page more.asp design The school news, educational research, famous teachers of famous schools and student parks on the home page only display 10 pieces of information in this category. How can I get more information? More. asp pages should be designed to display more information besides the home page. You can link to this page from the navigation bar on the home page. The navigation bar on the home page contains the following link statements: 1:<a href="more.asp?typeid=10">…</a> 2:<a href="more.asp?typeid=11">…</a> 3:<a href="more.asp?typeid=12">…</a> 4:<a href="more.asp?typeid=13">…</a> 5:<a href="more.asp?typeid=14">…</a> 6:<a href="more.asp?typeid=15">…</a> These link statements are linked to the more.asp file respectively, but the parameters passed are different. Typeid=10... 15 corresponds to the school news... Recruitment of talents. In this page, you can determine all the information that the category number in news is equal to the passed category number through the obtained pass parameters. The following is the interface diagram displayed on the page where the transfer parameter is 16: This page displays news information of typeid=16 in all news tables. The results of layout design in Dreamweaver UltraDev 4 are shown below: The following describes the technology of displaying all the information of the passed parameters on this page: First, use the following code to establish a recordset and implement SQL queries: set rs=server.createobject("adodb.recordset") rs.open "select * from news where typeid=" & cstr(typeid) & " and audit=1 order by ntime DESC",conn,1,1 Because there may be many records in the news table whose typeid is equal to the passed parameter, it is inconvenient to display them all in one page, so the page uses the paging display technology of data. The code for paging display used in this page is shown below: <% response.write "<hr size=0 width='80%'><div align=center>" Response. write "page<font color=red>"+cstr (curpage)+"</font>page/total<font color=red>"+cstr (rs. pagecount)+"</font>page" Response. write "This page<font color=red>"+cstr (i-1)+"</font>entries/total<font color=red>"+cstr (rs.recordcount)+"</font>entries" if curpage = 1 then Response. write "Front page of home page" else Response. write "<a href='more. asp? Typeid="&cstr (typeid)&"&page=1 '>Home</a><a href='more. asp? Typeid="&cstr (typeid)&"&page="&cstr (curpage-1)&"'>Front</a>" end if if curpage = rs.pagecount then Response. write "the last page of the next page" else Response. write "<a href='more. asp? Typeid="&cstr (typeid)&"&page="&cstr (curpage+1)&"'>Next Page</a><a href='more. asp? Typeid="&cstr (typeid)&"&page="&cstr (rs. pagecount)&"'>Last Page</a>" end if %> See Chapter 5 for the introduction of paging technology. On the left side of the page, the recommended content and hot articles are displayed. Here are the principles of implementing recommended content: Embed script in recommended content cell: <script language="javascript" src="news.asp?kind=hot&n=5"></script> The file called in the script is news.asp, and the parameters passed are kind and n. Here, the kind value is hot, and n is 5. The hot parameter here does not mean that the value of a field in the news table is hot. When realizing which information belongs to the hot category, it is output through the reverse order of hits in the news table in the sql query statement. That is to say, the records with the most hits are displayed. The value of parameter N transmits the number of displayed messages. The key sentences are as follows: sql="select top " & n & " * from news where typeid=" & cstr(typeid) & " and audit=1 order by hits DESC" In order to display the sub columns of the left classification guide, you can query the category with the current typeid number from the border table. Then, use the circular statement to display the sub category columns that meet the conditions in the border table to the page. rs6.open "select * from border where typeid=" & request("typeid") ,conn,1,1 Student comments in the student channel, student comments column belongs to the student channel column, but because student comments and student feedback are interactive columns, so in the background design, student comments are not taken as a subcategory of the student channel. Since they are not subcategories, they cannot be displayed here by querying from the border table. Therefore, in order to display this column here, an if statement can be used to determine the category value. If the category typeid number value is 17 (student channel), then use the if statement to determine and add sub columns such as displaying student messages. if request("typeid")=17 then response.write "<li type=circle><a href='bbs/' target=_blank>" Response. write "Student questions"&"</a>" response.write "<li type=circle><a href='bbs/' target=_blank>" Response. write "Student comments"&"</a>" end if 4.6 Implementation of background management login The login files include login.asp and check.asp. The Login.asp file provides the judgment that the input user name and password have been verified to be empty. Whether the correct user name and password are entered is passed to the check.asp file through the user name and password submitted in the form in the login.asp file and compared with the user name and password in the database. The correct user name and password are assigned to a session variable. Go to the management homepage. The implemented statements are as follows: session("purview")=rs("purview") session("name")=rs("name") response.redirect "admin/index.asp" The session variable is used to pass the login user's identity between different pages. Because only administrators can access the management page. All administrators use the session to pass the administrator's identity between different management pages when logging in. When the user name and password are assigned to a session variable, the webpage will also be turned to the management homepage. You need to verify your identity at the beginning of the management homepage. The verification is implemented by checking whether the session variable is empty. If it is empty, it indicates that a valid session has not been obtained through management login, and you cannot enter this page. The statements to realize this function are as follows: <% if session("purview")="" then response.redirect "../login.asp" response.end end if %> It can be seen from the above statement that if the session variable is empty, the login file login.asp will be turned. The following is a valid session variable login interface to the management home page: The implementation of this page uses framework technology. The whole page is divided into two parts: the left part is a list of user management operations. The right side is the corresponding page. The other pages of the management part and the implementation technology will not be introduced here. See the source code file for details. 4.7 Design of resource download column The key point of resource download is to design the addition of resource information and upload of resources. In the background management, the administrator can click the sub columns in the resource download column, such as the test paper download sub menu, to display the resource addition and resource upload pages. There are two steps to add resources. The first step is to upload resources to the server, record the upload path to the resource table, and the second step is to add the text information of resources to the background information table. The Addziyuan. asp file is used to upload resources and save the upload path to the resource table. In order to upload, ADO Stream and FSO objects are required. In ASP, FSO means File System Object, that is, file system object. The computer file system we are going to manipulate, in this case, refers to the one located on the web server. Use FSO and other technologies to create upload folders on the server side. The basic principle is to read all the data in the FORM using the BinaryRead method of the ADO Stream object, intercept the required file data from it, and save it as a binary file. <form action="addziyuan.asp" target="_blank" enctype="multipart/form-data" method="post"> <tr bgcolor="#FFFFFF"> <td width="20%"> <div align="right">Upload files</div> </td> <td width="80%"> <input type = "file" name = "filePic" size = "30"> <input type="submit" name="Submit" value="Upload"> </td> </tr> </form> Document objects are used in the program, so the original data read from upload_5xsoft.inc using the BinaryRead method is not only the data of the selected document itself, but also contains the description of the path and type of the document on the user's hard disk, the form domain name of the submitted page and other relevant information, so we need to extract the specific content of the document from it. According to the analysis, the header of the data and the boundary of the data are two pairs of carriage return and line feed characters, and there is also separation information at the end. We can use the following methods to obtain file data. set objForm=Server. CreateObject("Scripting.Dictionary") set objFile=Server. CreateObject("Scripting.Dictionary") if Request. TotalBytes<1 then Exit Sub set tStream = Server. CreateObject("adodb.stream") set Data_5xsoft = Server. CreateObject("adodb.stream") Data_5xsoft. Type = 1 Data_5xsoft. Mode =3 Data_5xsoft. Open Data_5xsoft. Write Request. BinaryRead(Request.TotalBytes) Data_5xsoft. Position=0 RequestData =Data_5xsoft. Read Use the binary file operation method provided in ADO STREAM to complete. The statement to save the file is StreamOBJ. SaveToFile (fileName, 2). In this operation, we can store the relevant operations in a class file, which can be directly included in the ASP program during application. After the file is uploaded, the system will save the uploaded path and the uploaded file name to the resource table. The code for saving the resource table is as follows: Set rs2 = Server. CreateObject("ADODB.Recordset") sql2="select * from ziyuan" rs2.open sql2,conn,3,3 rs2.addnew rs2("lujin")=szPath & szFileName rs2.update rs2.close 5. Technical features of the system ——Use the session variable to track and verify legitimate users. The session variable is used by the website administrator when logging in and entering the management page. When a user moves back and forth between Web pages on a Web site, the Session variable can be used to track the user. The session variable is closely related to cookies. In fact, the session variable depends on the cookie variable. The session variable is required when the website administrator logs in to the background management. It is convenient for administrators to move between different management pages to indicate their identity. First, get the variable in the check.asp file. The user name and password entered by the administrator when logging in are passed to check.asp and compared with the administrator user name and password in the database. A session variable is assigned to the correct user name and password. The specific statement is as follows: session("purview")=rs("purview") session("name")=rs("name") In the later management page, first judge whether the session ("review") is empty. If it is empty, it indicates that no valid session identity has been obtained. This will lead to the login. asp page to log in again. The statement to judge the session variable is as follows: <% if session("purview")="" then response.redirect "../login.asp" response.end end if %> Here are some other knowledge about the session variable: The session variable survives until the user leaves the Web site. How does the Web server detect this? By default, if the user has not requested a web page within 20 minutes, the Web server will consider that the user has left, and this default behavior can be changed through the Timeout property of the session object. Session. Timeout=60 Declare the Timeout property value in minutes. The new value of Timeout will be applied to the user's entire remaining session. In addition, before using the session variable, you should pay attention to the same shortcomings as cookies. When a client uses a browser that does not support cookies, the Web server cannot create an ASPSessionID cookie. Without the ASPSessionID cookie, when a user moves between pages, the session variable cannot contact the user. Therefore, avoid using session variables as much as possible. Through this website design, I have mastered a new system development tool FLASH5.0, Adobe Photoshop 6.0, Dreamweaver UltraDev 4 and Asp network technology. I was deeply impressed by the powerful functions of ASP components. ADO object developers provided the fastest, simplest and most efficient way to access all databases. With ADO, we can generate connections to databases in ASP scripts, and use this database connection to complete various database operations. ADO provides an application program interface for application level programs. At the same time, in the process of this design, I have always followed the idea of software engineering, which has significantly accelerated my work progress and reduced my detours. The idea of software engineering guides me step by step from system analysis, to system design, and then to system implementation. It gives me a clear overall idea of the development process of the whole system, and also reasonably arranges the time for the whole design. Due to my level and thinking limitations, there are still many deficiencies in the design of this site, which need to be improved in the future. Including: due to time and level, the web design is not exquisite. For example, the layout design is somewhat unreasonable, and the animation and pictures are not very attractive. These will be the direction of my efforts. This article was published by Beijing Website Construction Company Shangpin China //ihucc.com/
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).