The ASP ServerVariables collection can provide you with quite a bit of information found in the headers such as IP addresses, server name, virtual path, request method, etc. It is a common approach to use the ServerVariables collection to obtain your visitors’ IP address, user agent (browser) info, etc. The list of ServerVariables will depend on the server software and on the browser being used.

Syntax

Example

In this example, you can use the Response.Write method in conjunction with a For..Next loop to enumerate the ServerVariables Collection The following is a listing of the server variables that can be accessed in the ASP ServerVariables Collection. In the case where you only need to retrieve one server_variable, you could do so by using the Request.ServerVariables collections.