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...

                      Request.ServerVariables("ServerVariableName")

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
HTTP_USER_AGENT CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
REMOTE_ADDR 67.208.178.3
SERVER_NAME www.psacake.com
URL /web/el.asp
HTTP_REFERER

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

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


My3C's
perrychicker
It's easy... it's a PSACAKE!
Back | Tell A Friend | Search this Site
© 1998 - 2008 psacake.com
Version 3.23

Send me One Million FREE Guaranteed Visitors