ciao
vi mostro il codice
<%
Dim username
Dim password
username = Replace(Request.Form("username"), "'", "''")
Session("username") = username
Session.TimeOut = 1300 'minuti
password = Replace(Request.Form("password"), "'", "''")
Dim cn
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("databaseutenti.mdb" )
Dim sql
sql = "SELECT ID FROM utenti WHERE username='"&username&"' AND password='"&password&"'"
Dim rs
Set rs = cn.Execute(sql)
Dim autenticato
if rs.eof then
autenticato = false
else
autenticato = true
end if
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
if autenticato = true then
Session("autenticato") = "OK"
Response.Redirect("riservato.asp")
else
Response.Redirect("index.asp")
end if%>

Rispondi quotando