Recommended: Tips: Use GetString to increase the speed of ASP Many ASP programmers have had the experience of executing database queries and then displaying the query results in HTML tables. Usually we do this: The following is the quoted content:
What is ASP? ASP is the abbreviation of Active Server Pages, which is the active server page. ASP files are based on .asp as the extension. Its special feature is that all markup languages that can be used in Html files can be used in ASP files. Moreover, ASP files use <%...%> tags to embed programs in VB Script or Java Script script language into documents. When the server encounters this pair of flags, it is regarded as a program for interpretation and execution, and then the execution results are transferred to the client for user to browse, and the user cannot see the source file of ASP, so ASP is also called a server-side script file.
For browsers, there is almost no difference between ASP and HTML, just the difference between suffixes .asp and .htm. When we apply for ASP on the client, the server interprets the content between <% and %> into HTML language and transmits it to the client's browser. Our browser only accepts HTML format files, so it is suitable for any browser, whether it is IE or Netscape.
How to run ASP? It's very simple. You just need to install IIS (Internet Information Server) or PWS (Personal Web Server) on your computer and set the directory attributes of the ASP file you store as Execution. When you browse the ASP file, enter the URL (HTTP://…) in the browser to see the results of the ASP execution.
From what is said above, to learn ASP, you must first have some basic knowledge of HTML and VBScript (or Java Script). Because I use the VBScript scripting language in the writing of ASP, I hope you have some basic understanding of VBScript. Maybe you have learned VB, but VB and VBScript are different. VBScript can be said to be a subset of VB, and its syntax is basically the same as VB.
Let’s first talk about the ASP objects. There are five built-in objects that ASP itself has:
Object usage Server is used to provide various information about the server Request Used to read information submitted by the browser on the client Response Used to transfer information to the browser on the client Application Used to record common information between different web pages Session Used to record information of the connectors of each different client
In addition to the above objects, we can also use ActiveX objects. Unlike ASP's built-in objects, ActiveX objects usually require a specific object to be used before they can be used. For example, we want to create an object whose object name is assumed to be dx, and this object is the Connection object type belonging to the ADODB object library (in the file corresponding to a .DLL or .EXE file). Here we use the Set statement and the CreateObject function of the built-in object Server to create this object dx:
Set dx=Server.CreateObject(ADODB.Connection)
By executing the above statement, we create an ActiveX object dx.
Having said so much, what exactly can ASP do? Just look down and you will know:
(1). Different information can be displayed in your homepage according to different user objects (this can also be done using dynamic HTML)
(2). You can create a counter in your homepage
(3). The information submitted in the HTML FOTM can be stored in the database
(4). Users can use the database in the server (such as querying the database using keywords, etc.)
(5). You can create a message book in your homepage
(6).Can create chat rooms, search engines, e-shopping, etc.
Share: ASP implements the end of the long title with an ellipsis Extracting long articles from the database always hinders the layout of the web page. So, I want to extract a part of the characters fixedly, and then there is... a replacement afterward. 1. Principle: determine whether the length of the article exceeds the specified length. If it exceeds the specified length, only the specified one will be displayed.