HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/circ.itp/debug.asp
<%
' (SS,28/9/2004) sends email with the browser info, inc form values etc. '
' also writes to file '
Sub WebDebugLog(AParameter)

  Dim NL
  NL = Chr(13) & Chr(10)

  If Application("WebDebugLogType") = "" Then Exit Sub

  Dim LBody, LName, LKeyName, i
  LBody = ""

  LBody = LBody & "----------------" & NL
  LBody = LBody & "Server Date/Time" & NL
  LBody = LBody & "----------------" & NL
  LBody = LBody & Now & NL
  LBody = LBody & NL

  LBody = LBody & "------------------------" & NL
  LBody = LBody & "Parameter to WebDebugLog" & NL
  LBody = LBody & "------------------------" & NL
  LBody = LBody & AParameter & NL
  LBody = LBody & NL

  LBody = LBody & "----------------------" & NL
  LBody = LBody & "QueryString Collection" & NL
  LBody = LBody & "----------------------" & NL
  For Each LName in Request.QueryString
    LBody = LBody & LName & " = " & Request.QueryString(LName) & NL
  Next
  LBody = LBody & NL

  LBody = LBody & "---------------" & NL
  LBody = LBody & "Form Collection" & NL
  LBody = LBody & "---------------" & NL
  For Each LName in Request.Form
    LBody = LBody & LName & " = " & Request.Form(LName) & NL
  Next
  LBody = LBody & NL

  LBody = LBody & "------------------" & NL
  LBody = LBody & "Cookies Collection" & NL
  LBody = LBody & "------------------" & NL
  For Each LName in Request.Cookies
    If Request.Cookies(LName).HasKeys Then 'cookies with keys '
      For Each LKeyName in Request.Cookies(LName)
        LBody = LBody & LName & "(" & LKeyName & ")" & " = " & Request.Cookies(LName)(LKeyName) & NL
      Next
    Else ' normal cookies '
      LBody = LBody & LName & " = " & Request.Cookies(LName) & NL
    End If
  Next
  LBody = LBody & NL

  LBody = LBody & "-----------------" & NL
  LBody = LBody & "Session Variables" & NL
  LBody = LBody & "-----------------" & NL
  For Each LName in Session.Contents
    If IsArray(Session(LName)) Then
      For i = LBound(Session(LName)) To UBound(Session(LName))
        LBody = LBody & LName & "(" & i & ")" & " = " & Session(LName)(i) & NL
      Next
    Else
      LBody = LBody & LName & " = " & Session.Contents(LName) & NL
    End If
  Next
  LBody = LBody & NL

  LBody = LBody & "----------------------" & NL
  LBody = LBody & "Session Static Objects" & NL
  LBody = LBody & "----------------------" & NL
  For Each LName in Session.StaticObjects
    LBody = LBody & LName & " = " & LName & NL
  Next
  LBody = LBody & NL

  LBody = LBody & "---------------------" & NL
  LBody = LBody & "Application Variables" & NL
  LBody = LBody & "---------------------" & NL
  For Each LName in Application.Contents
    If IsArray(Application(LName)) Then
      For i = LBound(Application(LName)) To UBound(Application(LName))
        LBody = LBody & LName & "(" & i & ")" & " = " & Application(LName)(i) & NL
      Next
    Else
      LBody = LBody & LName & " = " & Application.Contents(LName) & NL
    End If
  Next
  LBody = LBody & NL

  LBody = LBody & "--------------------------" & NL
  LBody = LBody & "Application Static Objects" & NL
  LBody = LBody & "--------------------------" & NL
  For Each LName in Application.StaticObjects
    LBody = LBody & LName & " = " & LName & NL
  Next
  LBody = LBody & NL

  LBody = LBody & "----------------" & NL
  LBody = LBody & "Server Variables" & NL
  LBody = LBody & "----------------" & NL
  For Each LName in Request.ServerVariables
    LBody = LBody & LName & " - " & Request.ServerVariables(LName) & NL
  Next
  LBody = LBody & NL


  If Application("WebDebugLogType") = "File" Or Application("WebDebugLogType") = "Both" Then
    WriteToFile "logs/webdebug.txt", "***** START *****" & NL & NL & LBody & NL & "***** END *****" & NL & NL & NL
  End If
  If Application("WebDebugLogType") = "Email" Or Application("WebDebugLogType") = "Both" Then
    If Application("WebDebugLogEmail") <> "" Then
      SendEmail Application("WebDebugLogEmail"), "", "", Application("WebDebugLogEmail"), "Web Debug Log", LBody
    End If
  End If


End Sub

' (SS,29/9/04) writes given text to given file name '
' if file exists it is appended to else a new file created '
' there must be modify and write access for Internet Guest account to this file or folder '
Sub WriteToFile(AFileName, LText)
  Const ForAppending = 8
  Application.Lock
  Dim LobjOpenFile, LobjFSO, LstrPath
  LstrPath = Server.MapPath(AFileName)
  Set LobjFSO = Server.CreateObject("Scripting.FileSystemObject")
  If LobjFSO.FileExists(LstrPath) Then
    Set LobjOpenFile = LobjFSO.OpenTextFile(LstrPath, ForAppending)
  Else
    Set LobjOpenFile = LobjFSO.CreateTextFile(LstrPath)
  End If
  LobjOpenFile.Write LText
  LobjOpenFile.Close
  Set LobjOpenFile = Nothing
  Set LobjFSO = Nothing
  Application.UnLock
End Sub
%>