Accessing Server Variables

Every time an ASP Application/Web Page is accessed, the Web Server creates environment variables that contain information about the Browser, Web Server and the ASP Application/Web Page being accessed. You can easily access these environment variables by using the ServerObjects method of the Request Object. An example of the usage would be:


The ServerVariableName just needs to be replaced with the server variable you are wanting. Below is a list of some of the server variables that you can use to provide/view information about your ASP Applications/Web Pages.

Server Variable Result
URL /web/el.asp

To list all Server Variables... create a page like this:  

<font face="arial">
<table border=1cellspacing=2 cellpadding=2align=center valign=top>
For EachItem InRequest.ServerVariables %>
td><%= Item %></td><td> <%= Request.ServerVariables(Item)%></td> </tr>
<% Next%> </table> </font> </BODY> </HTML>

asp server variables Request ServerVariables

Back To Top
© 1998 - 2024
Version 7.21 | Advertise on this site