CONTROLLA INNANZITUTTO SE TUTTI I CAMPI SONO STATI COMPILATI CORRETTAMENTE
IF username <> "" and password <> "" and Instr(email, "@") > 0 and Instr(email,".") > 0 then
Se tutti i campi sono corretti gli dai il percorso del database
url_DB = ???
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open url_DB
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TABELLA_UTENTI where username = '" & username &"'"
RecSet.Open SQL, Conn, 3, 3
Qui parte il controllo che lo username non sia stato già utilizzato:
IF Not RecSet.Eof Then
usato = True
Else
usato = False
End IF
' Chiude la connessione al DB
RecSet.Close
Set RecSet = Nothing
IF usato = True then ( USERNAME GIA' USATO )
Else ( USERNAME DISPONIBILE USATO )
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TABELLA_UTENTI Order By ID Desc"
RecSet.Open SQL, Conn, 3, 3
RecSet.Addnew
RecSet("username") = username
RecSet("password") = password
RecSet("email") = email
.......