这个代码的作用就是如果没有来源的话就无法正常访问,有来源才可以正常访问,也就是禁止直接输入网址访问的意思。
ASP代码如下:

<%
'防止直接输入网址登陆
url=request.ServerVariables("HTTP_REFERER")
if url="" then
   response.redirect "http://"
   response.end
end if
%>

 

JS代码如下:

<script type="text/javascript">
if(document.referrer)
{
}else{
location.href="http://www.fish.com";
}
function closeErrors(){ return true; }
window.onerror=closeErrors;
</script>

相关文章:

  • 2022-02-25
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2021-07-03
  • 2021-08-21
  • 2022-12-23
  • 2021-07-28
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案