ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> ASP Articles -> ASP Request.ServerVariables collection

ASP Request.ServerVariables collection

ASP ServerVariables collection contains information about the server where your ASP script is running on information about the client requesting the ASP script. The ServerVariables collection can give you lots of information about the server settings – Server IP, Server name, Server virtual path, Server Software (IIS4, IIS5 or IIS6), etc. Using ServerVariables you can get your visitors’ IP address, their browser version, their browser language settings, etc.

The list of ServerVariables depends on the server software (IIS version) and on the browser being used. The ASP script below will return a list of all ServerVariables available on your server, when you request this page in your browser:

<%
For Each Item In Request.ServerVariables
Response.Write Item & " = " & Request.ServerVariables(Item) & "<br>"
Next
%>

Here is a sample list of some of the Request.ServerVariables collection members:

REMOTE_ADDR - The IP address of the remote host making the request.
REMOTE_HOST - The name of the host making the request.
REQUEST_METHOD - The method used to make the request. For HTTP, this might be GET, HEAD, POST, etc.
SCRIPT_NAME - A virtual path to the script being executed.
SERVER_NAME - The server's host name or IP address
SERVER_PORT - The port number to which the request was sent.




Contact Us