简体   繁体   English

如何从经典ASP的历史记录中获取上一页?

[英]How can I get the previous page from history in classic ASP?

Is there a way I can get the previous page the user was at in classic ASP? 有没有办法可以获取经典ASP中用户所在的上一页? I am looking for the equivalent of history.go(-1) in JavaScript. 我正在寻找JavaScript中的history.go(-1)

Depending upon your needs you may be able to use: 根据您的需求,您可以使用:

Request.ServerVariables("HTTP_REFERER");

Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. 返回一个字符串,该字符串包含使用<a>标记将请求引用到当前页面的页面的URL。 If the page is redirected, HTTP_REFERER is empty. 如果页面被重定向,则HTTP_REFERER为空。

Typically if I need to know where the user came from, though, I would set this explicitly in the querystring or in a form variable. 通常,如果我需要知道用户来自何处,则可以在查询字符串或表单变量中进行显式设置。

http://www.w3schools.com/asp/coll_servervariables.asp http://www.w3schools.com/asp/coll_servervariables.asp

Request.ServerVariables ( "HTTP_REFERER" ) Request.ServerVariables(“ HTTP_REFERER”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM