Displaying Source Code(s)
|
|
GetHeaders Function
--------------------------------------------------------------------------------
Description : GetHeaders returns all headers sent to the current
web page by a given user's browser. GetHeaders returns a
reference to a Scripting.Dictionary object. The Keys and Items
collections will be filled with all header name, value
combinations sent by the browser.
<%
Private Function GetHeaders()
Dim item, d, sKey, sItem
Set d = CreateObject("Scripting.Dictionary")
d.RemoveAll
For Each item In Request.ServerVariables
If Left(UCase(item), 5) = "HTTP_" Then
sKey = Replace(Right(UCase(item), Len(item) - 5), "_", "-")
sItem = Request.ServerVariables(item)
If Not d.Exists(sKey) Then d.Add sKey, sItem
End If
Next
Set GetHeaders = d
End Function
%> |
|
|