Recommended: How to use ASP to obtain the address of the client's real IP? To obtain the client's real IP address through the proxy server, you must use Request.ServerVariables(HTTP_X_FORWARDED_FOR) to read it. But it should be noted that not every proxy server can use Request.ServerVariab
Generally, large-scale websites are less and less likely to use ASP for architecture, but ASP still occupies a large market scope in small and medium-sized business sites. ASP is favored by small and medium-sized site administrators for its simple, short development cycle and easy maintenance. However, as far as I know, those who use ASP to integrate and update and maintain websites are only common for real business sites or relatively mature technical sites. More websites only have some independent columns using ASP programs. This feature is that site management is too scattered. For example, whenever you enter a column management, you have to enter a different account and password. Not only is it wastes the administrator's energy, but it also increases the difficulty of maintaining the website. Many of the ASP programs used in single columns we see are source codes that are searched for from the Internet, which will also threaten the security of your website, because the source code provided on the Internet is open, and everyone can study this code. When you know that the security of ASP is a long-term concern to users, and the open source code is even more dangerous. Of course, I do not disagree with everyone using the source code on the Internet. I just hope that you can pay attention to this issue and not fully believe in the use of the ideology. You still need to modify the areas where you need to modify, and you still need to patch the areas where you need to patch (of course, it is not to ask you to modify other people's copyright information).To sum up, I think anyone who has a certain understanding of ASP can develop a complete station system and integrate it. The purpose of this topic is to guide everyone how to build a complete set of dynamic web sites.
In order for readers of all levels to understand this article, it is necessary to first talk about the following words:
If you are a beginner, what should you master?
Necessary VBScript and JavaScript. VBS, as the main ASP program writing language, comes from Visual Basic. People who have learned VB can quickly master it. Needless to say, JavaScript is embedded in a web page, and the client uses an ordinary scripting language. You'd better have a certain amount of HTML language knowledge, otherwise you'll feel very annoyed.
The basis of SQL statements is also the basis!
In the early stage, you don’t have to master everything, just do the basics.
Prerequisite: We will use the most basic statements and functions to write a complete site system for web dynamic sites.
As long as you read this topic carefully, you can basically master the ideas of web site development and be able to give them practical applications. Of course, as you learn more, you can add more features or improve your program algorithms.
(1) Conduct demand analysis of the website:
Many people ignore this point. They believe that developing web site programs does not require the idea of software engineering, which will actually lead to disordered web sites. For example, some people don’t think about any site they want to develop, and start writing code directly, and write whatever they think of. Until they finish writing, they find that I still need to have no other functions, and then they immediately return to add code. In this way, the program is prone to errors. Therefore, at the beginning, it is recommended that you formulate the requirements analysis of web site development like software engineering, which should include the basic requirements of the developed web system, such as: functions, performance, user base, basic data processes and processing processes, and security and confidentiality requirements. The goals, conditions, assumptions, restrictions, etc. of the web system.
To put it more specifically, as for our site, it is a technical site, which should include news systems, article systems, download systems, etc. So what functions these systems need to have is the problem we need to analyze.
Let’s analyze the functions to be implemented from examples:
News System: The most important thing about a news system is that it can convey news to users in real time. So what functions should the news system have? Publication time, click count, insert image, and some notes to the author of the news source. Of course, these are very easy to implement functions. Inserting pictures can be solved using the html function, ubb conversion table or uploading pictures. These methods will not be explained one by one in this article. You can refer to relevant information.
In fact, no matter what system you have, after you have analyzed its needs in detail at the beginning, it will definitely be easier and more efficient to implement than writing wherever you think of. If it is convenient, it is recorded using computers or paper to record the development requirements of the web system, and it can also be referenced during the development process. One topic that I have to mention here is about user verification. Generally, we use session and cookies for user verification. Session variables and cookies are of the same type. If a user sets his browser to be incompatible with any cookies, the user cannot use this Session variable and cookies. Generally speaking, I personally recommend using session for website administrators because our theme is to develop web sites, so administrators must jump in multiple management pages. The session is very convenient here. If the user is verified, then cookies can be used. For example, the user can set a forced browser to store cookies on the computer. It can be easily done by using the Expires attribute of response.cookies. Another point is that the sessionID information is very easy to lose. For clusters like users that have been accessed for a long time, it is necessary to create a user ID by storing a dedicated cookie in the user's web browser and saving the cookie information to the database.
In the above section, we talked about the preliminary requirements analysis of web site development, which I personally think is a very important step in website engineering.
(2) Organize and manage site structure
Often when developing a site of a certain scale, it is worth noting to make the site have a good directory structure. Business applications often require the ability to run scripts and components inside a transaction. Transactions are server-side operations. In short, even if the operation contains many steps, such as placing an order, viewing an order, printing an order, etc., it can only return as a whole whether the operation succeeds or fails. Users can create ASP scripts running inside the transaction. If any part of the teaching book fails, the entire transaction will terminate.
What we want to explain in detail here is not the application of transactional scripts throughout the site, but the purpose of preventing you from being confused by the numerous files and operations during development.
Reasonably organize file names. For example: we name the management page admin.asp, and the pages in the management page that operate on each column can be underlined after admin and then named the column, such as the news management page admin_news.asp, and the download management page admin_download.asp
About the placement of files. I am just explaining it in my way, and I believe you can have your own opinions. All management operation pages are placed under the same directory to facilitate management and allocation of permissions. The user pages of each column can be placed in a directory for easy management. The database can be placed under a unified directory.
How to reduce the number of files. There is no need to create many new pages for each addition, deletion, modification or other operation. You can use parameters to reduce pages. For example, in the management page admin_news.asp, perform the addition operation when admin_news.asp?action=addnew, and perform the delete operation when admin_news.asp?action=del, which will greatly enhance the degree of integration of your site.
Reusable code. Many codes can be reused, such as UBB's conversion tables, etc., and they can be placed separately in a directory.
(3) Development backend management
I don't know if all the developers are like me, first after the backend development is completed. Or you are doing it together. However, I think it is more appropriate to develop the backend first. We have said before that we must analyze the system first and have a clear idea of what functions to achieve. Only by doing this will you achieve twice the result with half the effort and will reduce many unnecessary mistakes. Backend management has nothing more than the following functions:
1) User verification
2) Add website data
3) Modify website data
4) Delete website data
5) Site system settings
6) Site visit statistics
7) Collect user information
...
How to manage what they agree with is the problem we need to solve. For example, user verification can be implemented like this:
<%
...
username=replace(trim(request(username)),',)
password=replace(trim(Request(password)),',)
set rs=server.createobject(adodb.recordset)
sql=select * from admin where password='&password&' and username='&username&'
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
if password=rs(password) then
session(admin)=rs(username)
session(flag)=rs(f
Share: Use ASP Trojan to implement FTP and decompression The most troublesome thing about putting a website on a broiler is to update and upload a large number of files. Terminal services are easily discovered during broad daylight, and you are not at ease when you open an ftp. I went around the Internet and found that it can be easily implemented by combining component-free uploading and asp Trojans. Asp Trojans are very familiar with everyone.