<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer=True %> <% Dim RecSet, Errore If ((Request.Form(“Cognome”) = “”) Or (Request.Form(“Nome”) = “”)) Then Response.Write “Devi inserire obbligatoriamente cognome e nome” & “
Response.Write “” Response.Write “Fai clic per tornare al modulo” & “” Else Errore = False Set RecSet = Server.CreateObject("ADODB.RecordSet") RecSet.Open "AnagraficaStudenti", Conn, , adLockOptimistic, adCmdTable Do While Not (RecSet.EOF Or Errore) If (StrComp(RecSet(“Username”), Request.Form(“Username”), vbTextCompare) = 0) Then Response.Write “Attenzione!! Username già esistente” & “
” Response.Write “” Response.Write “Fai clic per tornare al modulo” & “” Errore = True End If If (StrComp(RecSet(“Password”), Request.Form(“Password”), vbTextCompare) = 0) Then Response.Write “Attenzione!! Password già esistente” Response.Write “” Response.Write “Fai clic per tornare al modulo” & “” Errore = True End If RecSet.MoveNext Loop If Not Errore Then RecSet.AddNew RecSet("Cognome") = Request.Form("Cognome") RecSet("Nome") = Request.Form("Nome") RecSet("Indirizzo") = Request.Form("Indirizzo") RecSet("CAP") = Request.Form("Cap") RecSet("Città") = Request.Form("Citta”) RecSet.Update Response.Write “Registrazione effettuata correttamente” End If RecSet.Close Set RecSet = Nothing End If Conn.Close Set Conn = Nothing %>