Prevent others from illegal link this site picture

xiaoxiao2021-03-06  15

Sometimes we don't want other websites to link our resources (such as pictures) to process the following methods. We collected HTTP_REFERRER with Request.ServerVariables, and then determine whether the link from the outside according to the value of this variable from the outside to prevent illegal links. First, we need to use the following quote: Do as the getImage.asp we do: <% OPTION EXPLICITDIM Server_Link, FilePathServer_Link = Request.ServerVariables "Http_referrer") Server_Link = MID (Server_Link, INSTR (Server_Link, ") 1) Server_Link = Left (Server_Link, INSTR (Server_Link," / ") - 1) IF server_link =" 72b.net "ThenfilePath =" picture Folder address " Request.QueryString (" FNAME ") ElseFilePath =" / images / illegal link .jpg "end iFResponse.redirect (filepath)%>

Transfer from: http://goarer.xicp.net/Article/showArticle.asp?id=194

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

New Post(0)