<% 'This ASP script originally lived at http://evolvedcode.net/ for the 'original version of this script and a wide variety of other 'scripts, please visit the site. Option Explicit Dim objFSO, objStream Dim i Const ForAppending = 8 Const bAudit_ServerVars = True Const bAudit_FormData = True Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objStream = objFSO.OpenTextFile( Server.MapPath( Request.ServerVariables("SCRIPT_NAME") ) & ".log" , ForAppending, True ) objStream.WriteLine "Date: " & Now() objStream.WriteLine "Script: " & Request.ServerVariables("SCRIPT_NAME") objStream.WriteLine "" If bAudit_ServerVars Then objStream.WriteLine "Server Variables:" 'Cycle through all the items that compose the server ' variables collection For i = 1 To Request.ServerVariables.Count 'Store the key name and the associated item value to ' variables objStream.WriteLine "'" & Request.ServerVariables.Key(i) & "' = '" & Request.ServerVariables.Item(i) & "'" Next End If If bAudit_FormData Then 'Check if data was supplied via the form If Request.Form.Count > 0 Then objStream.WriteLine "" objStream.WriteLine "Form Data:" 'Since we appear to have data, cycle through all items supplied to us, ' writing out the key name and the value of that item For i = 1 To Request.Form.Count objStream.WriteLine "'" & Request.Form.Key( i ) & "' = '" & Request.Form.Item( i ) & "'" Next End If End If objStream.WriteLine "" objStream.Close Set objStream = Nothing Set objFSO = Nothing %>