hysql.org技术站
当前位置:首页 > 编程10000问 > 正文

如何侦测HTTP表头信息?

<html>

<head>

<title> 千花飞舞之HTTP headERS侦测< /title>

</head>

<body>

<TABLE BORDER=1>

<tr><td VALIGN=TOP><B>变量</B></td>

<td VALIGN=TOP><B></B></td></tr>

<% For Each key In Request.ServerVariables %>

<tr>

<td><% = key %></td>

<td>

<%

If Request.ServerVariables(key) = "" Then

If GetAttribute(key) = "" Then

Response.Write " "

Else

Response.Write GetAttribute(key)

End If

Else

Response.Write Request.ServerVariables(key)

End If

Response.Write "</td>"

%>

</tr>

<% Next %>

</TABLE>

</body></html>

 

<%

Function GetAttribute(AttrName)

Dim AllAttrs

Dim RealAttrName

Dim Location

Dim Result

AllAttrs = Request.ServerVariables("ALL_HTTP")

RealAttrName = AttrName

Location = instr(AllAttrs, RealAttrName & ":")

If Location <= 0 Then

GetAttribute = ""

Exit Function

End If

Result = mid(AllAttrs, Location + Len(RealAttrName) + 1)

Location = instr(Result, chr(10))

If Location <= 0 Then Location = len(Result) + 1

GetAttribute = left(Result, Location - 1)

End Function

 %>

版权保护: 本文由 首页 原创,转载请保留链接: http://www.hysql.org/biancheng/20180610/2051.html

博客主人YeLongCu
男,文化程度不高性格有点犯二,已经20来岁至今未婚,闲着没事喜欢研究各种代码,资深技术宅。
  • 文章总数
  • 1131482访问次数
  • 建站天数
  • 标签