Lo script è lunghissimo:



<%@LANGUAGE="VBSCRIPT"%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Abandon
MM_logoutRedirectPage = "default.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<!--#include file="foto_connessione.asp" -->
<%
' *** Edit Operations: declare variables


MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If


' boolean to abort record edit
MM_abortEdit = false


' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables


If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then


MM_editConnection = MM_connDUclassified_STRING
MM_editTable = "afoto"
MM_editColumn = "AD_ID"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "foto.asp"
MM_fieldsStr = "AD_TITLE|value|numero|value|comune|value|campo1|v alue|campo3|value|sezione|value|AD_date|value|camp o4|value|campo5|value|AD_VIEWED|value|AD_DESCRIPTI ON|value|AD_IMAGE|value|campo15|value|campo2|value |campo6|value|campo8|value|campo13|value|campo9|va lue|campo10|value|campo11|value|campo12|value|camp o14|value|campo16|value|campo17|value|campo18|valu e|campo19|value|campo20|value|campo21|value|campo2 2|value|campo23|value|campo24|value|campo25|value| campo26|value|campo27|value|campo28|value|campo29| value|campo30|value|campo31|value|campo32|value|ca mpo33|value|campo34|value|campo35|value|campo36|va lue|campo37|value|campo38|value|campo39|value|camp o40|value|campo41|value|campo42|value|campo43|valu e|campo44|value|campo45|value|campo46|value|campo4 7|value|campo48|value|campo49|value|campo50|value| campo51|value|campo52|value|campo53|value|campo54| value"
MM_columnsStr = "AD_TITLE|',none,''|numero|none,none,NULL|comune|' ,none,''|campo1|',none,''|campo3|',none,''|sezione |',none,''|AD_date|',none,''|campo4|',none,''|camp o5|',none,''|AD_VIEWED|',none,''|AD_DESCRIPTION|', none,''|AD_IMAGE|',none,''|campo15|',none,''|campo 2|',none,''|campo6|',none,''|campo8|',none,''|camp o13|',none,''|campo9|',none,''|campo10|',none,''|c ampo11|',none,''|campo12|',none,''|campo14|',none, ''|campo16|',none,''|campo17|',none,''|campo18|',n one,''|campo19|',none,''|campo20|',none,''|campo21 |',none,''|campo22|',none,''|campo23|',none,''|cam po24|',none,''|campo25|',none,''|campo26|',none,'' |campo27|',none,''|campo28|',none,''|campo29|',non e,''|campo30|',none,''|campo31|',none,''|campo32|' ,none,''|campo33|',none,''|campo34|',none,''|campo 35|',none,''|campo36|',none,''|campo37|',none,''|c ampo38|',none,''|campo39|',none,''|campo40|',none, ''|campo41|',none,''|campo42|',none,''|campo43|',n one,''|campo44|',none,''|campo45|',none,''|campo46 |',none,''|campo47|',none,''|campo48|',none,''|cam po49|',none,''|campo50|',none,''|campo51|',none,'' |campo52|',none,''|campo53|',none,''|campo54|',non e,''"


' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next


' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If


End If
%>
<%
' *** Update Record: construct a sql update statement and execute it


If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then


' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId


If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close


If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If


End If
%>
<%
Dim rsUser__MMColParam
rsUser__MMColParam = "1"
if (Session("MM_Username") <> "") then rsUser__MMColParam = Session("MM_Username")
%>
<%
set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.ActiveConnection = MM_connDUclassified_STRING
rsUser.Source = "SELECT mem_name, mem_password FROM user_red WHERE mem_name = '" + Replace(rsUser__MMColParam, "'", "''") + "'"
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 3
rsUser.Open()
rsUser_numRows = 0
%>
<%
Dim rsafoto__MMColParam
rsafoto__MMColParam = "1"
if (Request.QueryString("ad_id") <> "") then rsafoto__MMColParam = Request.QueryString("ad_id")
%>
<%
set rsafoto = Server.CreateObject("ADODB.Recordset")
rsafoto.ActiveConnection = MM_connDUclassified_STRING
rsafoto.Source = "SELECT * FROM afoto WHERE AD_ID = " + Replace(rsafoto__MMColParam, "'", "''") + ""
rsafoto.CursorType = 0
rsafoto.CursorLocation = 2
rsafoto.LockType = 3
rsafoto.Open()
rsafoto_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsafoto_numRows = rsafoto_numRows + Repeat1__numRows
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("Username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="foto.asp"
MM_redirectLoginFailed="errore_red.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connDUclassified_STRING
MM_rsUser.Source = "SELECT mem_name, mem_password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM USER WHERE mem_name='" & MM_valUsername &"' AND mem_password='" & CStr(Request.Form("Password")) & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters


' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_kee pNone=""


' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next


' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next


' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)


' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>