Take the HTML file technology

zhaozj2021-02-08  235

Take the HTML file technology

http://www.asp888.net tofu technology station

A lot of sites suffix are HTML files, and even some sites have such a file suffix HTML? URL = asp888.net, some

Friends may be very confused, can HTML files can also be programmed like ASP files? In fact, everyone is deceived.

I am here to tell you how this technology is achieved.

First we need to do some preparations:

Create a Test directory: and set him into a virtual directory in IIS, we have a "custom error" tab in IIS management tools

, We found 404 errors, choose editing errors, we will shoot 404 to /test/404.asp

Let's take a look at the reason we do. We know, when we visit a file that does not exist, IIS will give

We returned a 404 error, we now go to visit a similar to http: //localhost/test/20001204001.htm file,

I know that this file does not exist! ! ! ! But we have been in front of it, this error is intercepted, we will be wrong.

To 404.asp file, we do some processing in the 404.asp file, we can handle this so-called 20001204001.htm

Document.

404.asp code is as follows:

<%

DIM STRERRPAGE ()

STRERRPAGE = Split (Request.SerVariables ("Query_String"), ";")

Response.write STRERRPAGE (1)

%>

The output of this program is: http://localhost/test/20001204001.htm, we can further get 20001204001 parameters

Then we can achieve programming through this keyword like an ASP program.

Similarly, what can we understand and explain for so-called http: //localhost/test/gotohost.htm? Url = asp888.net?

how about it? It's very simple? But it is a small trick! !

转载请注明原文地址:https://www.9cbs.com/read-3396.html

New Post(0)