时间: 2021-07-31 作者:daque
下列情景是从欣赏器的地方栏平常博得request.servervariables("http_referer")的: 1.径直用<a href> 2.用submit或<input type=image>提交的表单(post or get) 3.运用jscript提交的表单(post or get)底下咱们再看看request.servervariables("http_referer")不许平常取值的情景: 1.从保藏夹链接 2.单击'网页'大概自设置的地方 3.运用jscript的location.href or location.replace() 4.在欣赏器径直输出地方 5.<%response.redirect%> 6.<%response.addheader%>或<meta http-equiv=refresh>转向 7.用xml加载地方明显,request.servervariables("http_referer")在普遍情景下是不许平常处事的,底下咱们看一个例子:ref.asp<% response.write "you came from: " & request.servervariables("http_referer") %>ref.htm<% response.addheader "refresh", "10;url=ref.asp" %> <meta http-equiv='refresh' content='10;url=ref.asp'> <form method=get action=ref.asp name=getform> <input type=submit value=' go there (get) >> '> <input type=image style='cursor:hand'> </form><p> 看看上头的代码会获得什么的截止.<form method=post action=ref.asp name=postform> <input type=submit value=' go there (post) >> '> <input type=image style='cursor:hand'> </form><p> <a href='ref.asp'>径直链接</a><p> <a href='#' onclick='window.location.href="ref.asp";return false;'>javascript location</a><p> <a href='#'onclick='window.location.replace("ref.asp");return false;'>javascript replace</a><p> <a href='#' onclick='document.getform.submit();return false;'>javascript get</a><p> <a href='#' onclick='document.postform.submit();return false;'>javascript post</a>