% Session.Timeout = 20 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.CacheControl = "no-cache" %> <% ' Initialize common variables x_ID_Utente = Null x_Nome = Null x_Cognome = Null x_User = Null x_Password = Null c_Password = Null ' Initialize Password Confirmation Field x_Tipo = Null x_E2DMail = Null x_E2DMail2 = Null x_Utente_Visibile = Null x_Utente_Data = Null x_UltimoLogin = Null Response.Buffer = True ' Get action sAction = Request.Form("a_register") If (sAction = "" Or IsNull(sAction)) Then sAction = "I" ' Display blank record Else ' Get fields from form x_ID_Utente = Request.Form("x_ID_Utente") x_Nome = Request.Form("x_Nome") x_Cognome = Request.Form("x_Cognome") x_User = Request.Form("x_User") x_Password = Request.Form("x_Password") x_Tipo = Request.Form("x_Tipo") x_E2DMail = Request.Form("x_E2DMail") x_E2DMail2 = Request.Form("x_E2DMail2") x_Utente_Visibile = Request.Form("x_Utente_Visibile") x_Utente_Data = Request.Form("x_Utente_Data") x_UltimoLogin = Request.Form("x_UltimoLogin") End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str bUserExists = False Select Case sAction Case "A": ' Add ' Check for Duplicate User ID sUserSql = "SELECT * FROM [Utenti]" sUserSql = sUserSql & " WHERE [User] = '" & AdjustSql(x_User) & "'" Set rs = conn.Execute(sUserSql) bUserExists = Not rs.Eof rs.Close Set rs = Nothing If Not bUserExists Then If AddData() Then ' Add New Record ' Load Registrant Email sEmail = x_E2DMail2 ' Load Email Content If sEmail <> "" Then sEmailSubject = "" sEmailFrom = "" sEmailTo = "" sEmailCc = "" sEmailBcc = "" sEmailFormat = "" sEmailContent = "" Call LoadEmail("register.txt") sEmailFrom = Replace(sEmailFrom, "", "info@damaincasentino.it") ' Replace Sender sEmailTo = Replace(sEmailTo, "", sEmail) ' Replace Receiver sEmailContent = Replace(sEmailContent, "", x_Nome) sEmailContent = Replace(sEmailContent, "", x_Cognome) sEmailContent = Replace(sEmailContent, "", x_Password) sEmailContent = Replace(sEmailContent, "", x_E2DMail2) ' Send Email Call Send_Email(sEmailFrom, sEmailTo, sEmailCc, sEmailBcc, sEmailSubject, sEmailContent, sEmailFormat) End If Session("ewmsg") = "Registrazione avvenuta con successo" conn.Close Set conn = Nothing Response.Redirect "login.asp" End If End If End Select %>
Pagina di registrazione
Torna al Login
Utente già inserito!
<% End If %> <% '------------------------------------------------------------------------------- ' Function AddData ' - Add Data ' - Variables used: field variables Function AddData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy ' Add New Record sSql = "SELECT * FROM [Utenti]" sSql = sSql & " WHERE 0 = 1" sGroupBy = "" sHaving = "" sOrderBy = "" If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 3 rs.Open sSql, conn, 1, 2 rs.AddNew ' Field Nome sTmp = Trim(x_Nome) If Trim(sTmp) = "" Then sTmp = Null rs("Nome") = sTmp ' Field Cognome sTmp = Trim(x_Cognome) If Trim(sTmp) = "" Then sTmp = Null rs("Cognome") = sTmp ' Field Password sTmp = Trim(x_Password) If Trim(sTmp) = "" Then sTmp = Null rs("Password") = sTmp ' Field Tipo rs("Tipo") = 0 ' Set Default User Level ' Field E-Mail2 sTmp = Trim(x_E2DMail2) If Trim(sTmp) = "" Then sTmp = Null rs("E-Mail2") = sTmp If Session("Dama_status_UserLevel") <> -1 And Session("Dama_status_UserID") <> "" Then ' Non system admin rs("ID_Utente") = Session("Dama_status_UserID") End If rs.Update rs.Close Set rs = Nothing AddData = True End Function %>