ServerVar

Get value of Server variable by passing variable name
aVar can be any of these value:
ALL_HTTP, ALL_RAW, APPL_MD_PATH, APPL_PHYSICAL_PATH, AUTH_PASSWORD, AUTH_TYPE, AUTH_USER, CERT_COOKIE, CERT_FLAGS, CERT_ISSUER, CERT_KEYSIZE, CERT_SECRETKEYSIZE, CERT_SERIALNUMBER, CERT_SERVER_ISSUER, CERT_SERVER_SUBJECT, CERT_SUBJECT, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, HTTPS, HTTPS_KEYSIZE, HTTPS_SECRETKEYSIZE, HTTPS_SERVER_ISSUER, HTTPS_SERVER_SUBJECT, INSTANCE_ID, INSTANCE_META_PATH, LOCAL_ADDR, LOGON_USER, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_USER, REQUEST_METHOD, SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PORT_SECURE, SERVER_PROTOCOL, SERVER_SOFTWARE, URL, HTTP_CONNECTION, HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HTTP_COOKIE, HTTP_HOST, HTTP_USER_AGENT, HTTP_UPGRADE_INSECURE_REQUESTS

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ServerVar(Avar)
ServerVar = Request.ServerVariables(UCase(Avar))
End Function

' Or, or
Function HTTPUserAgent()
HTTPUserAgent = ServerVar("HTTP_USER_AGENT")
End Function
Function HTTPRemoteHost()
HTTPRemoteHost = ServerVar("REMOTE_HOST")
End Function
Function HTTPAcceptLanguage()
HTTPAcceptLanguage = ServerVar("HTTP_ACCEPT_LANGUAGE")
End Function
Function HTTPMethod()
HTTPMethod = ServerVar("REQUEST_METHOD")
End Function
Function HTTPURL()
HTTPURL = ServerVar("URL")
End Function
Function HTTPQueryString()
HTTPQueryString = ServerVar("QUERY_STRING")
End Function

aVar

Example of usage is here
<a href="http://ANmar.Space/Tests/ServerVars.asp" target=_blank>http://ANmar.Space/Tests/ServerVars.asp</a>

Views 4,531

Downloads 1,447

CodeID
DB ID