Recommended: General acquisition of the code for three articles in each article General code for three articles in the previous and next articles. The example uses an asp tutorial, which mainly understands SQL statements, where id refers to the current article. Previous three articles Sql=Selecttop3*From contentWhereidid Next three articles Sql=Selecttop3*FromcontentWhereidorderbyiddesc
At present, there are many illegal links to theft of web pages and files on other websites. The following method is to prevent links using asp code.The main idea is to use Request.ServerVariables to collect HTTP_REFERRER, and then determine whether the link comes from outside based on the value of this variable to prevent illegal links.
First, we need to quote the image as follows:
<imgsrc=/images/getimg.asp?FName=pic.jpg>
We do the following processing for getimg.asp:
<%
OptionExplicit
dimServer_Link,FilePath
Server_Link=request.ServerVariables(HTTP_REFERRER)
Server_Link=mid(Server_Link,InStr(Server_Link,.)+1)
Server_Link=left(Server_Link,InStr(Server_Link,/)-1)
IfServer_Link=code-123.comthen
FilePath=image folder address+Request.QueryString(FName)
Else
FilePath=/images/illegal link.jpg
EndIf
Response.Redirect(FilePath)
%>
Can achieve anti-theft chain effect.
Share: parse the ASP code to generate pictures of the phone number on the web page A good asp tutorial code, generate image format for phone numbers, save the following code as img.asp when using it, and insert img src=img.asp?tel=010-0000000 at the location where the phone number is to be displayed. % CallCom_CreatValidCode(Request.QueryString(tel)) PublicSubCom_CreatValidCode(pTel) '-----