Non è che mi riesce tanto bene, in realtà cmq:
codice:
'RECUPERO I DATI DAL FORM
strUser = request.form("user")
strCode1 = request.form("act_code")
strCode1 = cripta(strCode1,key)
strCode2 = request.form("new_code1")
strCode3 = request.form("new_code2")
strMail= request.form("mail")
'CONTROLLO SUI DATI DEL FORM
if(strUser<>"") AND (strCode1<>"") AND (strCode2<>"") AND (strCode2=strCode3) AND (strMail<>"") then
'ESEGUO QUERY DI CONTROLLO USERNAME E PSW
strSql = "SELECT * FROM codici WHERE userName = '"&strUser&"' AND userCode = '"&strCode1&"'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, cn, 3, 3
'SE PRESENTI
if not(rs.eof) then
UserCode = rs("UserCode")
UserCodeDue = rs("UserCodeDue")
UserCodeTre = rs("UserCodeTre")
UserCodeNuova = cripta(strCode2,Key)
UserID = rs("Utente_ID")
'CONTROLLO SU PSW
if UserCodeNuova = UserCode or UserCodeNuova = UserCodeDue or UserCodeNuova = UserCodeTre then
RESPONSE.WRITE "Questa password è già stata utilizzata in passato."
'ALTRIMENTI AGGIORNO IL DATO
else
sql_update = "UPDATE codici "
sql_update = sql_update & " set UserCode = '"&cripta(strCode2,Key)&"', "
sql_update = sql_update & " where utente_id = "& UserID
cn.Execute(sql_update)
RESPONSE.WRITE "Utente riconosciuto!"
end if
else
RESPONSE.WRITE "Utente non riconosciuto!"
'chiudo il database
rs.Close
set rs = Nothing
cn.Close
set cn = Nothing
end if
end if
%>