Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Cambiare password

  1. #1
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135

    Cambiare password

    Cosa c'è di sbagliato in questa condizione che non dovrebbe permettere di cambiare la propria password quando è uguale alla penultima ed alla terzultima? Cambia sempre la password anche se è uguale...
    codice:
    <%
    
    if(strUser<>"")AND(strCode1<>"")AND(strCode2<>"")AND(strCode2=strCode3)AND(strMail<>"") then
    
    'Apertura del database
    'Eseguo la query
    
    		Set rs = Server.CreateObject("ADODB.Recordset")
    		rs.Open strSql, conn , 3, 3	
    		
    		pass = rs("pass")
    		pass2 = rs("pass2")
    		pass3 = rs("pass3")
    		passNew = cripta(strCode2,Key)
    		
    
    		if not(rs.eof) then
    
    			'Utente in elenco. Modifico il dato.
    			
    if passNew = rs("pass") and passNew = rs("pass2") and passNew = rs("pass3") then
    
    		response.write "blablabla"
    else
    				rs(1)=strUser
    				rs(2)=cripta(strCode2,Key)
    				rs(3)=strMail
    		rs.update
    end if
    
    'invio email
    
    	else	
    		
    
    response.write "KO"
    
    
    		end if
    		end if
    
    		'chiudo il database
    		rs.Close
    		set rs = Nothing
    		conn.Close 
    		set conn = Nothing
    		
    %>

  2. #2
    Prova così.
    codice:
    <%
    
    if(strUser<>"")AND(strCode1<>"")AND(strCode2<>"")AND(strCode2=strCode3)AND(strMail<>"") then
    
    'Apertura del database
    'Eseguo la query
    
    		Set rs = Server.CreateObject("ADODB.Recordset")
    		rs.Open strSql, conn , 3, 3	
    		
    		pass = rs("pass")
    		pass2 = rs("pass2")
    		pass3 = rs("pass3")
    		passNew = cripta(strCode2,Key)
    		
    
    		if not(rs.eof) then
    
    			'Utente in elenco. Modifico il dato.
    			
    if passNew = rs("pass") and passNew = rs("pass2") and passNew = rs("pass3") then
    
    		response.write "blablabla"
    else
    				rs(1)=strUser
    				rs(2)=cripta(strCode2,Key)
    				rs(3)=strMail
    		rs.update
    end if
    
    'invio email
    
    	else	
    		
    
    response.write "KO"
    
    
    	'chiudo il database
    		rs.Close
    		set rs = Nothing
    		conn.Close 
    		set conn = Nothing
    
    		end if
    		end if
    		
    %>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.