Like somuch.com on Facebook Share somuch.com on Facebook somuch.com on Twitter Reddit LinkedIn Pinterest
Newest Tips & Tricks...

Home :: Tips & Tricks :: Active Server Pages

Obtain a Header List With ASP's ServerVariables Collection

The SeverVariables collection contains all kinds of information about the calling client and the server. For instance, you can determine a visitor's browser type with the HTTP_USER_AGENT variable. Or, you can use HTTP_REFERER to determine the referring Internet address. Not all browsers support the same headers, however.

To see a quick list of the headers supported within a browser, run the following code.

<TH colspan="2">ServerVariables</TH>
<%
For Each var in Request.ServerVariables
With Response
.Write("<TR>")
.Write("<TD><B>" & var & "</B>:</TD>")
.Write("<TD>" & Request.ServerVariables(var) & "</TD>")
.Write("</TR>")
End With
Next
%>
</TABLE>

Source: Mike D. Jones

Recommended Links...