Home | Advertising Info1054 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Wednesday, January 22, 2025  


Server Variables




USAGE:  Request.ServerVariables (variable)

Consult The Microsoft Documentation For A Full Description Of All The Server Variables Below.

Variable

ALL_HTTP
AUTH_TYPE
CONTENT_LENGTH
CONTENT_TYPE
GATEWAY_INTERFACE
HTTP_ACCEPT
HTTP_ACCEPT_LANGUAGE
HTTP_CONNECTION
HTTP_USER_AGENT
HTTP_COOKIE
HTTP_HOST
HTTP_COOKIE
LOGON_ACCEPT_ENCODING
PATH_INFO
PATH_TRANSLATED
QUERY_STRING
REMOTE_ADDR
REMOTE_IDENT
REMOTE_HOST
REQUEST_METHOD
SCRIPT_MAP
SCRIPT_NAME
SERVER_NAME
SERVER_PORT
SERVER_PORT_SECURE
SERVER_PROTOCOL
SERVER_SOFTWARE
URL
Here are two examples of what you could do with server variables.

HTTP_REFERER server variable can be used as a Dynamic Previous Page Hyperlink.

Paste this code into an asp file and you have an instant (Back Button).
Or add a graphic if you wish.

<a href="<%= Request.ServerVariables("HTTP_REFERER") %>">Previous Page</a>

Previous Page


HTTP_USER_AGENT server variable can determine the client browser type

<%=Request.ServerVariables("HTTP_USER_AGENT")%>

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)


Retrieve a Users IP Address Using Server Variables

Regarding there server variables you can always loop through them as well and show all of them which is very helpful when testing.

<table border="1" width="500" style="border-collapse: collapse">
<%
For each item in Request.ServerVariables
   Response.Write("<tr><td>" & item & "</td><td>")
   Response.Write(Request.ServerVariables(item))
   Response.Write("</td></tr>" & vbCrLf)
Next
%>

</table>

 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com