帮忙解释一段asp代码??
index.html
<script language="vbs">
set objXmlHttp=createobject("microsoft.xmlhttp")
strLocation = "/index.asp?ref=" & escape(document.referrer)
objXmlHttp.open "GET", strLocation, false
objXmlHttp.send
if objxmlHttp.status = 200 Then
msgbox objxmlHttp.responseText
End If
</script>
index.asp:
<%
strHttp_referer = request.querystring("ref")
if strHttp_referer = "" then strHttp_referer = "直接进入"
response.write strHttp_referer
%>
帮忙解释一下?
还有帮忙改一下代码,让index.html所提示的内容传给index.asp并打印?
谢谢!
------解决方案--------------------
<script language="vbs">
set objXmlHttp=createobject("microsoft.xmlhttp") ’声明对象
strLocation = "/index.asp?ref=" & escape(document.referrer) ‘把index.asp+来源网址赋给strLocation
objXmlHttp.open "GET", strLocation, false ’获取网址strLocation页面中的内容
objXmlHttp.send ‘发送
if objxmlHttp.status = 200 Then ’如果文档存在并获取到
msgbox objxmlHttp.responseText ‘弹出上面网址页面中的内容
End If
</script>
<%
strHttp_referer = request.querystring("ref") ’接收参数并赋值
if strHttp_referer = "" then strHttp_referer = "直接进入" ‘如果来源网址为空则赋值“直接进入”
response.write strHttp_referer ’输出
%>
index.html的提示的内容就是index.asp中输出的strHttp_referer
不知道你搞这有什么意思?