ho provato a ripristinare una pagina "add_blog.asp" che avevo modificato per inserire il controllo CAPTCHA e gli smile entrano. Ora non so dove sbattere la testa. Provo a postare il codice della pagina sbagliata.
Codice PHP:
<%@LANGUAGE="VBSCRIPT"%>
<%
Function CheckCAPTCHA(valCAPTCHA)
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function
%>
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
if CheckCAPTCHA(strCAPTCHA) = true then
%>
<%
Response.Buffer = True
Dim iMonth, iYear
iMonth=Request ("month")
iYear=Request ("year")
if iMonth = "" then iMonth = Month(Now)
sMonth=NameFromMonth(iMonth)
if iYear = "" then iYear = Year(Now)
Dim blog_id
Dim rsblog
Dim blog_autore
Dim blog_email
Dim blog_titolo
Dim blog_testo
Dim blnComments
Dim strMode
Dim strEmailSubject
Dim strEmailBody
Dim page
Dim Block
Dim msg
Dim errore
Dim data
Dim ora
Dim mese
Dim anno
Dim mese_inserimento
errore = false
page = Request.Form("page")
Block = Request.Form("Block")
strMode = Request.Form("strMode")
if Ublogtype = "closed" then
If Session("admin") = False or IsNull(Session("admin")) = True then
Response.Redirect"login.asp?strMode=" & strMode & ""
End If
end if
If strMode = "edit" Then blog_id = CLng(Request.Form("blog_id"))
If Trim(Request.form("blog_autore")) = "" Or Trim(Request.form("blog_titolo"))= "" Or Trim(Request.form("blog_testo"))= "" Then
errore = true
End If
blog_autore = Request.Form("blog_autore")
blog_email = Request.Form("email")
blog_titolo = Request.Form("blog_titolo")
blog_testo = Request.Form("blog_testo")
' Format user input and remove html tags
blog_autore = removeAllTags(blog_autore)
blog_email = removeAllTags(blog_email)
blog_titolo = removeAllTags(blog_titolo)
If strMode = "new" AND Ublogtype = "open" Then
blog_testo = removeAllTags(blog_testo)
blog_testo = UBBcode(blog_testo)
else
blog_testo = removemaligno(blog_testo)
End if
blog_testo = Replace(blog_testo, VbCrLf, "
")
' end format
data = Request.Form("data")
ora = Request.Form("ora")
blnComments = CBool(Request.Form("comments"))
mese = Request.Form("mese")
anno = Request.Form("anno")
If mese <> "" Then
mese_inserimento =Right(CStr(100+mese), 2)
else
mese_inserimento =Right(CStr(100+Month(Date)), 2)
end if
Set rsblog = Server.CreateObject("ADODB.Recordset")
If errore = false then
If strMode = "edit" Then
strSQL = "SELECT blog.* FROM blog WHERE blog.blog_id = " & blog_id & ";"
Else
strSQL = "SELECT Top 1 blog.* FROM blog;"
End If
rsblog.CursorType = 2
rsblog.LockType = 3
rsblog.Open strSQL, strCon
If NOT strMode = "edit" Then rsblog.AddNew
rsblog.Fields("blog_titolo") = blog_titolo
rsblog.Fields("blog_testo") = blog_testo
rsblog.Fields("blog_autore") = blog_autore
rsblog.Fields("blog_email") = blog_email
If data <> "" Then
rsblog.Fields("data") = data
else
rsblog.Fields("data") = Date()
end if
If ora <> "" Then
rsblog.Fields("ora") = ora
else
rsblog.Fields("ora") = Time()
end if
rsblog.Fields("mese") = mese_inserimento
If anno <> "" Then
rsblog.Fields("anno") = anno
else
rsblog.Fields("anno") = Year(Date)
end if
rsblog.Fields("commenti") = blnComments
rsblog.Update
rsblog.Requery
If blnEmail = True AND strMode <> "edit" Then
strEmailSubject = strLangSubjectEmailNewBlog
strEmailBody = strLangEmailHi
strEmailBody = strEmailBody & "
" & strLangEmailBodyBlog1 & ""
strEmailBody = strEmailBody & "
" & strLangEmailBodyBlog2 & ""
strEmailBody = strEmailBody & "
[b]" & strLangFormTitle & ": [/b]" & blog_titolo
strEmailBody = strEmailBody & "
[b]" & strLangFormAuthor & ": [/b]" & blog_autore
strEmailBody = strEmailBody & "
[b]" & strLangFormEmail & ": [/b]" & email
strEmailBody = strEmailBody & "
[b]" & strLangFormText & ":[/b]<b??Sr>" & blog_testo
Dim objCDOMail
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = Ublogname & " <" & emailamministratore & ">"
objCDOMail.To = "<" & emailamministratore & ">"
objCDOMail.Subject = strEmailSubject
objCDOMail.Body = strEmailBody
objCDOMail.BodyFormat = 0
objCDOMail.MailFormat = 0
objCDOMail.Importance = 1
objCDOMail.Send
Set objCDOMail = Nothing
End If
rsblog.Close
Set rsblog = Nothing
If strMode = "edit" then
msg = strLangInfoEditBlog
Response.Redirect "editallblog.asp?page="& page & "&Block="& Block &"&msg="& msg &""
elseif Ublogtype ="open" then
Response.Redirect "index.asp"
else
msg = strLangInfoInsertBlog
Response.Redirect "editallblog.asp?msg="& msg &""
end if
end if
%>
<html>
<head>
<title><% = Ublogname %></title>
<LINK href="include/styles.css" rel=stylesheet>
</head>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><div class="hrgreen">[img]immagini/spacer.gif[/img]</div></td>
</tr>
<tr>
<td colspan="2" align="right"><% if strMode= "edit" then %><u><% = strLangNavEditBlog %></u> [img]immagini/freccia.gif[/img][img]immagini/freccia.gif[/img] <font class="arancio">[b]
<% = data %><% else %><u><% = strLangSelectNewBlog %></u> [img]immagini/freccia.gif[/img][img]immagini/freccia.gif[/img] <font class="arancio">[b]
<% = Date() %><% end if %>
[/b]</font> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" height="250">
<tr>
<td width="3" rowspan="2" background="immagini/punto.gif">[img]immagini/bianco.gif[/img]</td>
<td valign="top" align="center">
<% If errore = True Then %>
<% = strLangErrorMessageNeedAuthorTitleText %>
<% if strMode = "new" then %>
[url="newblog.asp"]<% = strLangNavBackPrevPage %>[/url]
<% else %>
[url="edit_blog.asp?blog_id=<% = blog_id %>"]<% = strLangNavBackPrevPage %>[/url]
<% End If
End If %>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<p align="center">
<%
else
%>[b]<font size="3">
<tr>
<td height="37" colspan="2" align="center"></font>[/b]<b style="color:#FF0000">
<font size="3">
<%Response.Redirect ("code_err.htm")%>
<style type="text/css">
div.counter {
margin-top: 20px;
color: blue;
font-size: 60pt;
cursor: default;
}
</style>
<%
end if
end if
%><%
Set adoCon = Nothing
Set strCon = Nothing
%>