I\'ve looped over the Request.ServerVariables collection in ASP.NET, but it\'s not as comprehensive as phpinfo().
How can I print all that
For ASP classic with VBScript (not ASP.net - see disclaimer below) there is a Sub aspinfo() on Planet Source Code, to which I've made very minor changes (moving the call to aspinfo() and moving the top authorship/comment block).
Here is the source of my modified version of Dennis Pallett's aspinfo(), which can be saved as aspinfo.asp on the webserver in question.
<%@ Language="VBSCRIPT" %>
<%
'**************************************
' Name: aspinfo()
' Description:aspinfo() is the equivalent of phpinfo(). It displays all kinds of
' information about the server, asp, cookies, sessions and several other things in
' a neat table, properly formatted.
' By: Dennis Pallett (from psc cd)
'
'
' Inputs:None
'
' Returns:None
'
'Assumes:You can include my code in any of your pages and call aspinfo() to show
' the information of your server and asp.
'
'**************************************
Sub aspinfo()
Dim strVariable, strASPVersion
Dim strCookie, strKey, strSession
'Retrieve the version of ASP
strASPVersion = ScriptEngine & " Version " & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion
%>
aspinfo()
ASP (<%= strASPVersion %>)
Server Variables
<%
For Each strVariable In Request.ServerVariables
Response.write("")
Response.write("" & strVariable & " ")
Response.write("" & Request.ServerVariables(strVariable) & " ")
Response.write(" ")
Next 'strVariable
%>
Cookies
<%
For Each strCookie In Request.Cookies
If Not Request.Cookies(strCookie).HasKeys Then
Response.write("")
Response.write("" & strCookie & " ")
Response.write("" & Request.Cookies(strCookie) & " ")
Response.write(" ")
Else
For Each strKey In Request.Cookies(strCookie)
Response.write("")
Response.write("" & strCookie & "(" & strKey & ") ")
Response.write("" & Request.Cookies(strCookie)(strKey) & " ")
Response.write(" ")
Next
End If
Next
%>
Session Cookies
<%
For Each strSession In Session.Contents
Response.write("")
Response.write("" & strSession & " ")
Response.write("" & Session(strSession) & " ")
Response.write(" ")
Next
%>
Other variables
Session.sessionid <%= Session.sessionid %>
Server.MapPath <%= Server.MapPath ("/") %>
<%
End Sub
aspinfo()
%>
Disclaimer: Note that this was initially submitted as an edit to Rob's answer, but it was suggested that it be made as an entirely new answer response instead. Note also that, as frankadelic points out in a comment to Rob's answer, this response doesn't address the OP's question, as that question was for ASP.net, not ASP classic.