Request.ServerVariables in classic Asp



我有这个要求:我需要保存访问我网站的用户所做的搜索词。 该网站是用经典的asp制作的。 我尝试过: Request.ServerVariables ("HTTP_REFERER"( Request.ServerVariables ("ALL_HTTP"(

但是我没有得到搜索查询 (q=( https://www.google.com/search?q=house

如何获取 q= 的值?

以下代码将为您提供所需的内容:

Response.Write(Split(Split(Request.ServerVariables ("HTTP_REFERER"), "?")(1),"=")(1))

当然,您将需要对其进行调整:如果您没有查询字符串,它将失败,并且您正在寻找的参数必须是第一个。

最新更新