Comunque il codice del file add_message.asp è il seguente:
codice:
<%@LANGUAGE="VBSCRIPT"%> <% Response.Buffer = True Dim msg_id Dim rsguest Dim msg_name Dim msg_email Dim msg_city Dim msg_country Dim msg_homepage Dim msg_icq Dim message Dim msg_date Dim strMode Dim strEmailSubject Dim strEmailBody Dim msg Dim CallEmailFunction Dim errore Dim errormessage errore = false strMode = Request.Form("strMode") msg_date = Request.Form("msg_date") If strMode = "new" Then msg_date = Now() If strMode = "edit" Then msg_id = CLng(Request.Form("msg_id")) If Trim(Request.form("msg_name")) = "" Or Trim(Request.form("message"))= "" Then errore = true errormessage = strLangErrorMessageNeedAuthorText End If If strMode = "new" Then If Request.form("message") <> "" And LongWords(Request.form("message")) = False Then errore = true errormessage = strLangErrorLongWord End If End If msg_name = Request.Form("msg_name") msg_email = Request.Form("msg_email") msg_city = Request.Form("msg_city") msg_country = Request.Form("msg_country") msg_homepage = Request.Form("msg_homepage") msg_icq = Request.Form("msg_icq") message = Request.Form("message") ' Format user input and remove html tags msg_name = removeAllTags(msg_name) msg_name = BadWords(msg_name) msg_email = removeAllTags(msg_email) msg_email = BadWords(msg_email) msg_city = removeAllTags(msg_city) msg_city = BadWords(msg_city) msg_country = removeAllTags(msg_country) msg_country = BadWords(msg_country) msg_homepage = removeAllTags(msg_homepage) msg_homepage = BadWords(msg_homepage) msg_icq = removeAllTags(msg_icq) msg_icq = BadWords(msg_icq) If msg_homepage="http://" then msg_homepage = "" If msg_icq <> "" Then If Not IsNumeric(msg_icq) Then msg_icq = "" ElseIf Len(msg_icq) < 5 Then msg_icq = "" End If End If If strMode = "new" Then message = removeAllTags(message) message = UBBcode(message) message = FormatText(message) Else message = removemaligno(message) End if message = Emoticon(message) message = BadWords(message) message = Replace(message, VbCrLf, "
") ' end format If errore = false then Set rsguest = Server.CreateObject("ADODB.Recordset") If strMode = "edit" Then strSQL = "SELECT message.* FROM message WHERE message.msg_id = " & msg_id & ";" Else strSQL = "SELECT Top 1 message.* FROM message;" End If rsguest.CursorType = 2 rsguest.LockType = 3 rsguest.Open strSQL, strCon If NOT strMode = "edit" Then rsguest.AddNew rsguest.Fields("Name") = msg_name rsguest.Fields("Email") = msg_email rsguest.Fields("City") = msg_city rsguest.Fields("Country") = msg_country rsguest.Fields("Homepage") = msg_homepage rsguest.Fields("Icq") = msg_icq rsguest.Fields("Message") = message rsguest.Fields("Date") = msg_date rsguest.Update rsguest.Requery If blnEmail = True AND strMode <> "edit" Then strEmailSubject = strLangSubjectEmailNewMessage strEmailBody = strLangEmailHi strEmailBody = strEmailBody & "
" & strLangEmailBodyMessage1 & "" strEmailBody = strEmailBody & "
" & strLangEmailBodyMessage2 & "" strEmailBody = strEmailBody & "
" & strLangGlobTableMessage3 & ": " & msg_date strEmailBody = strEmailBody & "
" & strLangFormAuthor & ": " & msg_name If msg_email <> "" Then strEmailBody = strEmailBody & "
" & strLangFormEmail & ": " & msg_email End If If msg_city <> "" Then strEmailBody = strEmailBody & "
" & strLangFormCity & ": " & msg_city End If If msg_country <> "" Then strEmailBody = strEmailBody & "
" & strLangFormCountry & ": " & msg_country End If If msg_homepage <> "" Then strEmailBody = strEmailBody & "
" & strLangFormHomepage & ": " & msg_homepage End If strEmailBody = strEmailBody & "
" & strLangFormText & ":
" & ReverseEmoticon(message) CallEmailFunction = InviaEmail(strEmailBody, emailamministratore, strEmailSubject, strEmailComponent) End If rsguest.Close Set rsguest = Nothing If strMode = "edit" then msg = strLangInfoEditMessage Response.Redirect "editallmessage.asp?page="& Request.Form("page") & "&Block="& Request.Form("Block") &"&msg="& msg &"" Else Response.Redirect "index.asp" End if End if %> <html> <head> <title><% = Uguestname %></title> <LINK href="include/styles.css" rel=stylesheet> </head> <table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="600" align="center" valign="top">
<% If strMode = "new" Then %> <% = UCase(strLangFormAddMessage) %> <% Else %> <% = UCase(strLangFormEditMessage) %> <% End If %>
<% If errore = True Then %> <% = errormessage %>
<% If strMode = "new" Then %> <% = strLangNavBackPrevPage %>
<% Else %> <% = strLangNavBackPrevPage %>
<% End If End If %> <% Set adoCon = Nothing Set strCon = Nothing %> </td> </tr> </table>