Salve a tutti..
Scrivere un titolo di un post in maniera corretta è forse piu difficile che postare gli errori!
Ho una pagina per il log-in degli utenti, fin ora solo 2.
Utente 1 login PIPPO and passw PLUTO
Utente 2 login ADMIN and passw ADMIN
Anche se inserisco le credenziali dell'utente 2 mi logga come utente 1![]()
La cosa strana e che quando inserisco le credenziali del secondo utente, nel DB il campo USE_HITS che conta quanti accessi fanno gli utenti viene incrementato correttamente, qindi conta l'accesso! e che visualizzo tutti i dati dell'utente 1
Da premettere che lo script nn l'ho creato io, ma sto adattando 1 che è sempre andato ottimamente.
Quanche consiglio?
Posto la pagina
codice:' *** Validate request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString) MM_valUsername=CStr(Request.Form("NAME")) If MM_valUsername <> "" Then MM_fldUserAuthorization="USE_ACCESS" MM_redirectLoginSuccess="configuration.asp?p=1" MM_redirectLoginFailed="logout.asp?reason=Accesso%20negato&login_tipe=1" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_connIWGallery_STRING MM_rsUser.Source = "SELECT USE_ID, USE_NAME, USE_PASSWORD" If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source & " FROM USERSRICARICHE WHERE USE_NAME='" & Replace(MM_valUsername,"'","''") &"' AND USE_PASSWORD='" & Replace(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 set cmdHits = Server.CreateObject("ADODB.Command") cmdHits.ActiveConnection = MM_connIWGallery_STRING cmdHits.CommandText = "UPDATE USERSRICARICHE SET USE_HITS = USE_HITS + 1 WHERE USE_ID = " & MM_rsUser("USE_ID") & " AND USE_NAME = '" & MM_rsUser("USE_NAME") & "'" cmdHits.CommandType = 1 cmdHits.CommandTimeout = 0 cmdHits.Prepared = true cmdHits.Execute() ' username and password match - this is a valid user Session("MM_Username") = MM_valUsername Response.Cookies("IWGalleryUserName") = MM_valUsername Response.Cookies("IWGalleryUserID") = MM_rsUser("USE_ID") If (MM_fldUserAuthorization <> "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value) ResponSe.Cookies("IWGalleryAccess") = 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

Rispondi quotando