Summary: Based on the implementation process of the website of the School of Mathematics and Metrology, this paper summarizes the related technologies of HTML, ASP and database, and uses WIN2000+ASP+ACCESS platform to analyze and design the website of the School of Mathematics and Metrology. The research of this paper will focus on the design of database and the application of ASP to realize each functional module in the information management system, which is a typical application of program database website technology. The design content of this paper mainly includes the following aspects: 1. System overview 2. System design 3. Database design and implementation 4. Background system and database configuration 5. Front end Website production And design Keywords: Internet, HTML, ASP, database design
Abstract:
This article outlined one whole process of THE ONLINE SJXY, and outlined some technologies about HTML, ASP and Accessing the Data Base. And outlined the whole process of how to analyses, design, empolder and debug the application for the ONLINE SJXY. This thesis stresses the functional modules applied in the design of database, the use of ASP, showing a typical application of technologies from program to databases to network, this thesis is divided into five parts primarily, one by one in order for:1 the discuss of the using software,2 The design of the system design, 3 database of the website with realize, 4 the backstage system installs with database, 5 the development of the head network and design Key words:Internet, HTML, ASP, Data Base
About the author: Nong Hao Guizhou University for Nationalities, School of Mathematics and Computer Science, Computer Science and Technology
1. Preface
The Internet is a common transmission control protocol followed by a large number of computers distributed around the world /Transmission Control Protocol/Internet Protocol; TCP/IP is connected, so it is called "network in network" or international network. Internet is a great milestone in the development of human history. It is the embryonic form of the future information superhighway, from which human beings are entering an unprecedented information society. People call the Internet by various names, such as the Internet, the Internet, the interactive network, the Internet, and so on. It is extending and spreading to all continents in the world, constantly adding and absorbing new network members, and has become the computer information network with the widest coverage, the largest scale, and the richest information resources in the world. Today, with the rapid development of the Internet, the Internet has become an important channel for people to quickly obtain, release and transmit information. It plays an important role in people's politics, economy, life and other aspects. On January 17, 2006, the China Internet Network Information Center (CNNIC) released the 17th Statistical Report on the Development of China's Internet. The survey report shows that as of December 31, 2005, the total number of Internet users in China has reached 110 million. However, publishing information on the Internet is mainly achieved through websites, and obtaining information is also to download the required information from websites in the Internet "ocean" according to certain retrieval methods. Therefore, the position of website construction in the Internet application is obvious. It has become an important part of the information construction of the government, enterprises and institutions, and has attracted much attention.
1.1 Demand analysis of digital college website
Since the establishment of the School, the construction of the School has developed rapidly and achieved remarkable results. It is more and more urgent to show the outstanding achievements and style of the college to all sectors of society and improve the popularity of the college. Today, with the increasing popularity of the Internet, people get the fastest and most complete information through the Internet every day, so the website of the School of Mathematics and Computer Science of Guizhou University for Nationalities is constructed. It is a good publicity window, which can not only show the teaching and research achievements of our school to all sectors of society, show the charm of teachers and students, and the history of origin, but also realize the real-time release of news, notices and other hospital affairs online, so as to improve the efficiency of running a school.
1.2 Current development status and current situation of dynamic network design technology
1.2.1 Current situation of dynamic network technology Most commercial websites have a large amount of data and information, and the original purpose of building a network is to facilitate customers to query
Enterprise information is convenient for communication with customers and timely information feedback. Then, it is inevitable to face how to make users In the browser interface, query the information of the WEB database through the Internet or Intranet, or even input, update and delete the information on the WEB server. Here are some common "dynamic" technology developments The full name of ASP is Active Server Pages, which is a development environment of WEB server. It can generate and execute dynamic, interactive and high-performance WEB service applications. ASP uses the scripting language VBScript (JavaScript) as its own development language. PHP is a cross platform server-side embedded scripting language. It heavily borrows the syntax of C, Java and Perl languages, and couples PHP's own features, so that Web developers can quickly write dynamically generated pages. It supports most databases at present. Another point is that PHP is completely free of charge. You can go to the PHP official website( //www.php.net )Free download. And you can get the source code without restriction, and even add the features you need. JSP is a new generation of website development language launched by Sun Corporation. Sun Corporation, with its extraordinary attainments in Java, has made new achievements in Java beyond Java applications and Java Applets, namely JSP, Java Server Page. JSP can complete powerful site programs with the support of Serverlet and JavaBean. All three provide the ability to mix certain program code in HTML code and interpret and execute program code by language engine. However, the JSP code is compiled into a servlet and interpreted and executed by the Java virtual machine. This compilation operation only occurs when the JSP page is first requested. In ASP, PHP and JSP environments, HTML code is mainly responsible for describing the display style of information, while program code is used to describe processing logic. Ordinary HTML pages only rely on the Web server, while ASP, PHP, JSP pages need additional language engine analysis and execution program code. The execution result of the program code is re embedded into the HTML code, and then sent to the browser together. ASP, PHP and JSP are all Web server oriented technologies, and client browser does not need any additional software support.
1.2.2 Technical orientation and current development situation of the website of the School of Statistics At present, all colleges and universities in the country have their own websites, which is an inevitable product of the Internet era. In the process of research, there are many promotional websites similar to those of schools of mathematics: (1) Rapid development with a large increase in quantity. With the development of the Internet and the application of modern educational technology, many colleges and universities have established their own websites (pages), and some have even established websites with their own domain names. The author uses Google search engine to fill in the keyword "college and university" to search, and can search many related websites of colleges and universities. (2) The technical level of website production is constantly improving, but the overall level is still low. Many college websites use power
The network system may use Asp and other technologies to realize online management. Of course, more websites stay in the simple few Page format. (3) . The development of the website is unbalanced and the quality is generally low. This is due to the unbalanced development of modern educational technology in the region And teachers' information technology level. Through Google search and visiting various colleges and universities, the author found that most of the colleges and universities that open promotional websites are in coastal areas such as Jiangsu Province, Zhejiang Province, Fujian Province and Guangdong Province. These areas belong to the economically developed areas in China. Modern educational technology has also developed rapidly, and teachers' information technology level is also high.
1.3 Selection and advantages of development tools
1、 ASP (Active Server Pages) ASP is simple and easy to maintain. It is the best choice for small website applications. Through DCOM and MTS technology, ASP can even complete medium-sized enterprise applications. Therefore, ASP technology is used to build a dynamic interactive site in the website of the School of Statistics. Advantages of ASP: Active Server Pages: "dynamic server pages", generally referred to as "ASP". The reason why ASP is valued and used by everyone is that the execution results are in standard HTML format, and these programs are executed in the network server, and the "execution" of ASP can be correctly obtained by using common browsers (such as IE or Netscape) Results, and the ASP execution results are directly "browsed" in the browser, unlike VBScript or JavaScript, which are executed on the client browser. If VBScript is used to design the program, the client can display the program execution results in the IE browser. However, the client If you use Netscape browser, you cannot display the execution results of VBScript. 2. Dreamweaver MX Chinese The emergence of Dreamweaver MX in Chinese makes it easy to create a powerful website. It can easily create ASP and PHP websites that were previously considered very complex. Dreamweaver MX is a professional HTML editor for designing, coding, and developing Web sites, Web pages, and Web applications. Dreamweaver will provide a lot of tools to help you enrich your web creation experience, whether you are comfortable writing HTML code directly or prefer to work in a visual editing environment. With the visual editing function in Dreamweaver, you can quickly create pages without writing any code. However, if you prefer to code directly by hand, Dreamweaver also includes many coding related tools and functions. and
Moreover, with Dreamweaver, you can also use server languages (such as ASP, ASP.NET, ColdFusion markup Language (CFML), JSP, and PHP) to generate Web applications that support dynamic databases. Dreamweaver can also be used to create an entire website, but Dreamweaver itself is not suitable for processing pictures, and needs the cooperation of Photoshop or Fireworks. The process of using Dreamweaver to create a static site: create a new site → name the site file → define page properties → insert a table → define page size → convert to layout view → add content → insert navigation bar → convert to standard view work → add links → use code snippets → define and apply CSS → add dynamic interaction → link each page of the site. 3、Microsoft Windows Access2003 Access, the Windows database management system launched by Microsoft, is not only a relational database management system, but also designed as a Windows graphical user interface application generator. Microsoft has adopted the characteristics of dBASE and Foxpro, two relational databases, to design Access, adding forms and report design functions to it, and learning from Visual Basic language, adding many programming functions. Access 2003 in Chinese has the same operating interface environment as Word2003 and Excel 2003 in Office 2003 and the function of direct connection with them, and provides a more convenient shortcut for operation. Access 2003 is a completely object-oriented, event driven, relational desktop database system. Compared with other database management systems, it has the following characteristics: ① At the same time, it is oriented to database end users and database developers; ② Typical open database management system; ③ Support the application and development of multimedia; ④ A large number of functions are built-in; ⑤ Many macros are provided; ⑥ Online help function is provided; ⑦ Intelligent management function based on WEB; ⑧ More intelligent automatic spelling and grammar checker; ⑨ More in line with personal network users and needs. Based on these functions and features of Access 2003, we chose it to manage the data information involved in this software. So I chose ASP combined with Microsoft Access2003 and Macromedia Dreamweaver8 to build the website of Guizhou University for Nationalities.
2. Site design solution under B/S structure
2.1 Design idea
Through the website of the School of Statistics, we will comprehensively publicize, show our school running style, advantages and characteristics, as well as various teaching and scientific research achievements, release the school's major activities and enrollment policies, strengthen the connection between all sectors of society and the school, complete some school affairs on the Internet, and improve the efficiency of work. Therefore, our website has the following functions: 1. News and information system: realize online real-time release of updates, modifications, and deletions of various news information 2. On site search system: to search all kinds of articles by keywords 3. Member system: hierarchical management of members to achieve different levels of authority requirements 4. Student score management system: realize online real-time query of corresponding subject scores by individual student number 5. Voting system: it can listen to different opinions at the first time and can also be used for various voting
2.2 Scheme design
As the system positioning is an information interactive website, it is a news publicity site. Traditional C/S (Client/Server) architecture is obviously unsuitable. C/S is usually suitable for developing enterprise oriented applications, such as management information systems. As an Internet oriented Web application, B/S (Browser/Server) architecture is required. The client of B/S architecture is an indispensable browser for people to surf the Internet. The client of this method is simple and easy to learn, and the training cost is low. Its biggest feature is that the client is lightweight, which is often called "thin client". Therefore, the B/S architecture is rapidly expanding in the future. With the prosperity of the Internet, Internet information publishing is booming, and B/S has even eroded many traditional C/S markets.
browser
request Web Server Results (IIS/PWS)
request Database Result Server
Request Browser result
2.3 Composition and data processing mode of B/S mode
According to the above licensing, it is determined that the system runs on Microsoft's Windows NT series platform, uses IIS information server as the Web server, and uses ASP to complete the dynamic interaction function. The website needs to store data frequently, so the
The database management system is used to manage data, and the background database uses Microsoft Access It should meet the requirements.
2.4 System module function analysis
The website of the School of Statistics includes the following main functional modules: 1. News information classification release system function The news information release system is divided into two parts: front and back. The main function of the front desk is to provide users with quick query Watch all kinds of news. The background is mainly for administrators, including adding, modifying, and deleting news information. In addition, in the backstage, you can add, modify, and delete the classification of news information as needed. At present, the website of the School of Statistics is divided into four categories: in hospital news, in hospital notices, graphic information, and high-quality courseware. For example, in hospital notices are subdivided into notices from the School Work Committee and the School Office. 2. The user login, logout and registration management uses the wizard to provide the registration function for new users. The user enters the user name, password and other personal information The legitimacy verification of the system becomes an official user. The administrator gives the registered user corresponding permissions through the background system audit. If the user forgets the password, the wizard can find the password step by step by asking the system questions. 3. Message board, news comment management function Users can leave messages with the administrator in the station to communicate and put forward their own opinions and suggestions. You can also target a new Comment on the information, put forward their own opinions, and publish them at the corresponding position of the information after being reviewed and approved by the administrator background. 4. In station information query and search function In station information retrieval must provide users with quick and convenient ways to find the news and announcements they need And other information. Usually, news websites are classified according to some standards. The website of the School of Statistics adopts the commonly used classification methods of "by title", "by author", and "by content". 5. Voting and selection system function Voting system is a tool for doing some small surveys in the station, which directly reflects the current survey results. It can also be used as some Selection by secret ballot.
3. Site design analysis and function realization
3.1 Website database design
3.1.1 Demand analysis of website database Demand analysis of college website database is the most important link for system function division and system design Section, according to the system data flow chart, five database tables can be obtained: user information table (admin. db), news information table (News. db), voting information table (vote. db), guestbook and news comment management (Review. db), and bulletin board information table (board. db). The following is the use of data items and data structures required by the system: 1. User management: user information table, including user name, user password, user gender and password prompt. 2. News system: news number, news title, news type, news hits, author, release time, relevant links, etc. 3. Voting system: voting information table, voting content, voting option information, etc. 4. Guestbook and news comment management: call guestbook information and news comment information table, message (comment) content, signature, email address, etc. 5. Bulletin board: including announcement number, announcement title, announcement content, release time, etc.
3.1.2 Website database of the School of Statistics
Some entities only exist independently and have no relationship with other entities, such as the config table used to save the initial configuration of the system. However, some entities are related to each other. The database E-R diagram is shown in the figure below. The direction indicated by the arrow in the figure refers to the first side of the 1: n relationship according to the convention. If there are no arrows on either side, it is an n: m relationship.
3.1.3 Use ADO to access the website database of the School of Metrology In ASP, database access is realized through the ADO (ActiveX Data Object) object of the built-in Database Access Component. It is the most effective and simplest way to operate the database currently supported by Microsoft. It is a powerful data access and editing mode, so that most of the programmable attributes of data sources can be directly extended to Active Server. ADO provides a simple program model and perfect functions to process data. ADO can access and operate the database by writing applications using ODBC (Open Database Connectivity) or OLEDB (Object Link&Embedding Database) drivers. As shown in the figure, whether Access, SQL Server, Visual FoxPro, dBase or other databases are used, ADO objects can be accessed as long as the database has the corresponding ODBC or OLE DB driver. ADO has the advantages of fast running speed, easy use, small memory and disk space occupation, especially for Web sites accessed by a large number of users at the same time, these advantages are more important. 1. Creating and configuring ODBC data sources
ODBC (Open Database Connectivity) is the development of database system interconnection, which is developed by Microsoft It is used to develop the application program interface specification of database system. The ODBC specification provides a set of high-level call interface specifications and a dynamic link library based running support environment for applications. When using ODBC to develop database applications, the application only needs to call standard ODBC functions and SQL statements, and the underlying operation of the database is completed by the ODBC driver of each database. Therefore, database applications using ODBC interface have good adaptability and portability, and have the ability to access multiple databases at the same time, completely throwing away the defects of traditional applications. ODBC driver is similar to the hardware driver under Windows. For users, the driver covers the difference between different hardware
2. Creating and configuring ODBC data sources After the data source is created, a way to locate, identify and communicate with the database must be provided. There are two ways to establish this way: 1) Use DSN How to create and configure DSN: Click Add under Start/Settings/Control Panel/ODBC Data Source/System DSN, select a driver in the dialog box for creating a new data source, such as Microsoft Access Driver (*. mdb), and specify the data source name and path in the pop-up ODBC Microsoft Access Installation window. After completion, specify the DSN in the ASP program, such as<% cn. open "DSN=yourdsnname; UID=username; PWD=password”%>
(2) Specify the location of the database file directly in the ASP file, and omit the parameters to be set for different data sources There are differences. For example, Microsoft Access ODBC parameter settings:
<% conn=”driver={Microsoft Access Driver(*.mdb)}; dbq=”&_server.mappath(“source.mdb”)%>
Since the Data Institute does not have its own Web server, and the data institute website is located on the remote virtual server, it is troublesome to establish and modify the DSN settings. This method directly specifies the location of the remote database to solve this problem.
3.1.4 Connect the ASP site to the server. When we need to operate the server database, the first step is to connect the database to the server Connect. This requires the use of the Connection object of the ADO object. 1. Create Connection Object <% set cn=Server. CreateObject(“ADODB.Connection”)%> A Connection object instance named cn has been created. Through this object instance, you can use the Open method provided by the Connection object to open the connection to the database, and the Excel method to query the table in SQL 2. Open the connection to the database of the School of Statistics (1) Use the Open method <% set cn=Server. CreateObject(“ADODB.Connection”)%> cn.open “DSN=score99;UID=admin;PWD=”” %> (2) Use the ConnectionString property <% set cn=Server. CreateObject(“ADODB.Connection”)%> cn. Connection “DSN=score99;UID=admin;PWD=”” cn.Open %>
DSN: Specify the connected ODBC data source name UID: provides the user ID, which is used to log in to the server database. Access database receives each user; The database in the SQL server provides the "admin" user identity, and the password is empty PWD: the user password for logging in to the database. (3) Specify the connection directly in ASP For Access database, the corresponding ASP program is: <% Cn. open "Driver={Microsoft Access Driver (*. mdb)}; DBQ=database file name (including full path); UID=user name; PWD=user password" %> 3. Close the Connection object cn.close This method can disconnect the connection between the Connection object and the database, but the object still exists in memory. If you want to move the created Connection object out of memory, you need to use the statement Set cn=nothing
3.1.5 Use ASP Recordset to insert, delete, and update the school database After using the Connection object to open the database connection, you can use the Recordset provided by the ADO object module Object access table records, including reading, inserting, deleting or updating. Here are some common properties and methods of the Recordset object: Properties: AbsolutePosition: the absolute position of the current pointer, whose value is between the 1-ReordCount attribute. AbsolutePage: When the Recordset object is set to pagination, this property will return the current page number. BOF: If the pointer position is before the first record, it returns True; otherwise, it returns False. EOF: If the pointer position is after the last record, it returns True; otherwise, it returns False. Connection: Set the storage location of records. If the value of Connection is set to 2 (adUseServer), it indicates that The records are stored on the server side; If the value of Connection is set to 3 (adUseServer), the record is downloaded to the browser, which will increase the network traffic. Filter: Filter records. MaxRecord: the maximum number of records returned.
PageCount: returns the total number of pages. PageSize: When the Recordset object is set to pagination, PageSize is the number of records per page. PageCount: Set the number of all records contained by the pointer in the Recordset object. CursorType: set the direction of pointer movement in the Recordset object, When it is set to 0 (adOpenForwardOnly), it means that the pointer can only move to the next record, which is the default value; When it is set to 1 (adOpenKeyset), it means that the pointer can move up and down freely. The Recordset read before The object can see the updated records, but cannot see the newly added or deleted records; When it is set to 2 (adOpenDynamic), the pointer can move up and down. The Recordset object read before can see any changes, but Access will not eat this setting; When it is set to 3 (adOpenStatic), it is set when CursorLocation=3 (records are downloaded to the browser). The pointer can move freely, but the update, addition, and deletion of the read records cannot be seen. LockType: set whether records can be written to the table. 1 (adOpenForwardOnly) indicates that all records are read-only; 2 (adOpenDynamic) means that when we start to edit the field of a record, we lock the secondary record, and then unlock it after editing and calling the Update method to update. 3 (adOpenStatic), the record is locked only when the Update method is called for updating. If we do not call Update after editing a record and continue to move to other records for editing, ADO will automatically call the Opdate method to update the record edited before. To cancel the update, you can use the CanceUpdate method. 4 (adLockBatchOptimal) allows you to change the recording method in batch mode: AddNew: Insert a new record in the Recordset object. You need to execute the Update method to complete the addition. Clone: Copy an existing Recordset object. Delete: deletes the record pointed to by the current pointer in the Recordset object. MoveNext: the pointer moves down one record. MovePrevious: move the pointer up one record. MoveFirs: The pointer moves to the first record. MoveLast: The pointer moves to the last record. Move Num: move the pointer down Num records. Open: Get the Recordset object, which may contain all records of the table or records that meet the SQL query Update: Complete the update of a record in the Recordset object 1. Creating Recordset Objects
Set objRS=Server. CreateObject(“ADODB. Recordset”) 2. Open method objRs. Open Source Connection CursorType LockType CommandType Source: This is a command object or a string containing instructions. Connection: The Connection object used to open the database connection. CursorType: Sets the direction of pointer movement in the Recordset object. LockType: set whether records can be written to the table CommandType: sets the way to process the parameter Source. 3. Record of new table objRS.AddNew Title,Content The field name of a new record is Title, and the data is Content, such as: ObjRS. AddNew Array ("news title", "news content"), Aeeay ("test news", "test news content") add a record that the news title is "test news title" and the news content is "test news content". 4. Field names of read tables and data read field names: can be created in the form of tables, such as:
Read field value:
5. Use the Filter property to filter records Use objRS. Filter to filter records. When setting properties, you can include any logical operation as long as the return value is True or False. 6. Setting paged browsing When a table contains many records and cannot be displayed on the same page, it is necessary to set multiple pages of records for paged browsing. At the same time, it is necessary to add a hyperlink to the page number of records. If the viewer wants to see the page number of records, just click its hyperlink to see the page number of records. To do this, just make full use of the several attributes already introduced
AbsolutePage (returns the current page number), PageCount (the total number of pages), PageSize (defines the number of records per page).
3.1.6 Implementation of ADO access to the college database To sum up, the following steps are used to access the database with ADO. First, define an ADO connection object, and then open the data source Set cn=Server. Createobject ("ADODB. Connection") Cn. open "data source" The data source is the data source name set in "ODBC32" under "Control Panel". Next, execute the SQL command and store the results in the RecordSet object variable Set rs=cn.Execute(SQLstr) Third, the content of the record is obtained through the RecordSet set. The common ones are: rs ("record name"): read the content of a record rs.eof: whether the last record has been pointed to, true, not false rs.MoveNext: move the pointer of the RecordSet to the next record Finally, close the database. There are two actions: RecordSet and Connection rs.Close cn.Close
Create Object Instance
open the data source
Save the recordset to the recordset variable
Get records with the recordset method
close database ADO access database
3.1.7 Detailed design of website database Access database tools are used in the basic databases of the website of the School of Mathematics and Metrology. The database contains tables for 15 different topics. Here are five main data tables, which are briefly described. 1. Admin table This table is mainly used to store the user information table of the data college, including user name, user password, user gender and password Display information.
2. News table This table mainly stores news number, news title, news type, news hits, author, release time, and related information Links, etc.
3. Vote table This table mainly stores voting information table, voting content, voting option information, etc.
4. Review table This table mainly stores message book information and news comment information table, message (comment) content, signature, email address, etc.
5. Board table This table mainly stores the announcement number, announcement title, announcement content, release time, etc
3.2 Design of website page of the School of Statistics
3.2.1 Head navigation bar The navigation function is indispensable for any web application. The navigation bar in the system is divided into two parts: the head navigation bar and the tail navigation bar. The following statements can be found in most ASP files: The function of this line of code is to include the first navigation bar in the current page, which can maintain a unified style of the website. If top.asp is modified when necessary, it will be reflected in all the files containing it.
The navigation bar maintains the uniform style of the Web application site and facilitates modification, and also provides a basis for the browser to jump quickly and quickly within the site.
3.2.2 Main Functions Display The website of the School of Statistics is a website that comprehensively displays the school's style, scientific research achievements and other information, which determines that most of the functions of the website are realized on the home page. As shown in the figure, the important functions of the website of the School of Statistics can be seen at a glance:
In the figure, 1, 2 and 10 are site navigation bars, 3 are bulletin boards in the station, 4 are search in the station, and 5 are various news
3.3 Design of website key codes
3.3.1 Powerful ASP # include instructions In an ASP page, you can use the # include directive to insert the content of another file into the current page: this directive reads the entire content of the file and inserts it into the page instead of a line. This is a very useful technique for inserting HTML paragraphs. By separating the script from the content, a composition level is provided for the page. This means that if the script After modification, when the client opens the page again, the script modification will be automatically reflected in each page containing the file. For example, the acquisition of common database connections is included in all ASP pages as a separate module. index.asp
… conn.asp … <% db=”admin/database/#sjxy.mdb” set conn = Server. CreateObject(“ADODB.Connection”) connstr=”Provider=Microsoft. Jet. OLEDB.4.0; Data Source=” & Server. MapPath(“”&db&””) conn.Open connstr %> … In this way, when the database connection is modified, all database connections referenced by the pages containing conn.asp will be modified, thus greatly reducing the workload of code development. It can better ensure the quality of software, which is also the embodiment of modularization and reducing the coupling between software.
3.3.2 Control authority
Class administrator. They have corresponding permissions to manage article information. The system administrator has the highest management authority of the site: if session(“rank”)>1 then response. Write “
response. End
end if
The administrator's permission can be tracked through the rank attribute of the background administrator. The rank value is read from the database and placed in the session. For example, the above operation is only allowed for system administrators, while the rank value greater than 1 is not a system administrator according to the agreement, so an error page as above will be displayed.
All passwords stored in the system can be encrypted in an irreversible manner in MD5. The purpose of encryption is to prevent the password of each account, including the administrator, from being obtained directly by opening the Access database.
rs(“password”)=md5(trim(request.form(password”)))
3.3.3 Implementation of verification code login In order to prevent malicious users from constantly guessing the account password, the system uses the verification code. Main ideas of verification code
The idea is to generate a random number on the user's login interface, and enter the number at the same time when the user logs in. This random number recorded in the system and the user's input can be used for verification to prevent malicious requests for the login page.
The difficulty of using the verification code is to convert the number 9587 into a picture of 9587 as shown in the figure. This function is completed in a separate ASP page, which uses the Stream object of ADO to read and write the contents of the file.
<%
Option Explicit//Force declaration of all used variables NumCode
Function NumCode()
Response. Expires=- 1//If the Response If Expires is set to negative number or 0, cache response is disabled AddHeader "Pragma","no-cache"
Response. AddHeader "cache trol", "no cache"//Cache is prohibited
It is used to ensure that the page can automatically refresh, even if you use Back to return to the original page
dim zNum,i,j dim Ados,Ados1
Randomize timer
ZNum=cint (8999 * Rnd+1000)//Generate random number
Session ("GetCode")=zNum//Use session to store the value of random number
dim zimg(4),NStr NStr=cstr(zNum) For i=0 to 3
Zimg (i)=cint (mid (NSTr, i+1,1))//min The function returns the first character from the i+1 position of the NSir string, which means that zimg (i) corresponds to the i character of zNum
Next dim Pos
set Ados=Server. CreateObject("Adodb.Stream") Ados. Mode=3
Ados. Type=1
Ados. Open
set Ados1=Server. CreateObject("Adodb.Stream") Ados1.Mode=3
Ados1.Type=1
Ados1. Open//The ADO stream object can read the file content, and the Ados stream object is to read
include/body. Fix content Adobe LoadFromFile (Server. mappath ("include/body. Fix")) Ados1. write Ados. read (1280)//Read 1280 bytes
for i=0 to 3
Ados. Position=(9-zimg (i)) * 320//Calculate the position in the Ados stream, that is, subtract this value from 9 and multiply it by 320
Ados1. Position=i * 320//Calculate the position that should be written in the Ados stream, that is, 320 bytes
A number Ados1. write ados. read (320)//Write from include/body 320 bytes read in Fix
Next//Cycle through the four digits
//The Ados stream redirects to include/body Fix Ados. LoadFromFile (Server. mappath ("include/head. fix")) Pos=lenb (Ados. read())//The byte length of the content read by Ados. read() is returned Position=Pos
for i=0 to 9 step 1
For j=0 to 3//When j increases by 1, the value of Positiond increases by 320, which is just the same as the above value
Corresponding
Ados1.Position=i*32+j*320
Ados. Position=Pos+30*j+i*120
Ados.write ados1.read(30)
next
next
Response. ContentType="image/BMP"//The written type is a bmp image Adobe Position=0
Response. BinaryWrite Ados.read() Ados. Close:set Ados=nothing Ados1.Close:set Ados1=nothing
End Function
%>
3.3.4 CSS style sheet
CSS is short for Cascading Style Sheets. More people call it style sheet. As its name implies, it is a tool for designing web page styles. With the powerful functions of CSS, the web page will change greatly under your rich imagination. With very simple CSS statements, you can achieve many effects that require professional software to achieve. Use attributes to set page formats such as font, color, background, etc; Using positioning can make the page layout more standard and beautiful; The use of filters can make pages produce multimedia effects. In the website of the School of Mathematics and Metrology, this technology is used to standardize the unification of website fonts.
3.3.5 MD5 encryption algorithm
MD5 is a one-way encryption algorithm that only encrypts data. There is no way to decrypt the encrypted data. In the website of the School of Statistics, MD5 encryption is used to encrypt the user's login password. The user account security is guaranteed, and the database system is more secure.
4. Conclusion
At present, the website of the School of Mathematics and Computer Science of Guizhou University for Nationalities has been tested, reached the expected goal, and is normally used under the maintenance of the college network team.
4.1 Current problems in website construction
1. There is a security risk. Because the website of the School of Statistics rents a remote virtual server, there are limitations in the settings of IIS, ODBC, etc. This is a security risk that cannot be guaranteed by itself.
2. The content of the website is monotonous. In addition to the rich content in a few aspects, the content in other aspects is mostly just a brief introduction of the group and teachers, and the release of a few political teaching materials and resources is relatively monotonous. Some websites seem to be rich in content, but there are few really applicable content.
3. The update cycle is long and the content is aging. Website construction is a long-term complex system project. Regular updating and maintenance of website content is the basic requirement to maintain website vitality. However, from the actual situation of the survey, it is not optimistic. Many websites of the political teaching and research group focus on one-time construction rather than follow-up construction, and the update cycle is long.
4. The page is rigid, the form is single, and the technical content is low. Web pages are mostly static pages, lacking dynamic sense; Most of them are pure black and white text pages, lacking the attraction and impact to the eyeball; Most of the pages are arranged in a simple and inflexible way with many links. The lack of aesthetic feeling greatly reduces the interest of visitors to continue browsing.
5. The lack of interaction and service functions is reflected in the passive browsing of visitors, poor participation and interaction. For example, chat rooms, BBS and other communication platforms between teachers and students are lacking.
6. The characteristics of the website are not prominent. Due to the lack of time, the site page design has been built by borrowing similar websites from other brother schools.
4.2 Countermeasures for strengthening the website construction of the School of Statistics
1. Improve the information technology level of teachers and students in the college, change the concept of teacher education and teaching, and adapt to the characteristics of the network era. In the network era, the effectiveness of teaching will rely more on the "interactive" information transmission mode, between teachers and between teachers and
The interaction between students will be more equal.
2. Strengthen the investment in school hardware and software. It is a high investment project to change the teaching means, and it is also the industry with the highest scientific and technological content and relatively rapid technology update.
3. It is important to grasp the correct principles of network construction. It mainly includes: directionality principle - website resources are healthy, positive and beneficial. While ensuring the unity and diversity of resources,
It should be advocated that the content can reflect the characteristics of the group, such as the original achievements of the teachers of the group; Targeted principle - website content, column setting, web design, etc. should be based on the characteristics of teachers and students and the characteristics of the group,
Enhance the affinity and appeal of the website, attract teachers and students to take the initiative to participate, and combine education with pleasure; The principle of universality - the website construction should not only mobilize all information resources in the group, but also give full play to peers and scholars
Students' enthusiasm for participation, expand the scope of participation, and let teachers and students make common progress in participation; Service principle - integrate education and service, and enhance network service functions, such as setting up "modeling guide"
And "resource sharing".
4. Set up the interaction and service functions of the website of the School of Statistics. Through e-mail, chat room, BBS or message board, teachers and students can freely discuss, exchange and interact on hot and difficult issues of general concern in the context of equality and trust. In my opinion, the website of the School of Mathematics should first provide an online teaching and research platform for the teachers of this group, which is different from other publicity websites of colleges and universities, and can also better display the characteristic function of the website of the School of Mathematics - networked teaching and research of colleges. Of course, the website of the School of Mathematics and Accounting must also "go out" to strengthen the communication between the inter school teaching and research groups for common development.
Colleges and universities have made beneficial attempts to develop and use the network as a new field to carry out publicity and teaching assistance, and have achieved initial success. For example, the website construction of the Department of Architectural Engineering in our school can be said to be successful, providing us with a model. The website of the School of Mathematics and Metrology is just a small module of the management of the college affairs. In the future, we will make further efforts to constantly learn and research new technologies and develop more and better website functions that meet the needs of our modern office.
This article was published by Beijing Website Construction Company Shangpin China //ihucc.com/