熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

怎麼防止網頁的內容被別人采集

2022-06-13   來源: JSP教程 

  <%
****************************************
怎麼防止網頁的內容被別人采集非法的訪問你的網站
****************************************
dim onlyURLfrom ***指定來源網址
onlyURL="
from=trim(requestserverVariables("HTTP_REFERER"))
if from="" then ***來源為空:可能是直接輸入網址或小偷
responsewrite "<div style=’display:none’><p>拒絕小偷!!!"
responsewrite "<p>來自:" & from
responsewrite "<p>請訪問:<a " & onlyURL & ">" & onlyURL &"</a>"
responsewrite "<p><form name=’blankForm’ method=get action=’’></form>"
responsewrite "<p><script language=""JavaScript"">blankFormsubmit()</script>" & vbCRLF
responseend
else
if inStr(fromonlyURL)<> then
***非指定來源:盜鏈
responsewrite "<div style=’display:none’><p>拒絕盜鏈!!!"
responsewrite "<p>來自:" & from
responsewrite "<p>請訪問:<a href=’" & onlyURL & "’>" & onlyURL &"</a>"
responsewrite "<p><form name=’blankForm’ method=get action=’’></form>"
responsewrite "<p><script language=""JavaScript"">blankFormsubmit()</script>"
responseend
else ***來源正常將訪問後面的內容

end if
end if
%>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20478.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.