%@LANGUAGE="VBSCRIPT" %>
<% response.buffer = true
s = request.form("s")
'entro in questa condizione solo al ricarico della pagina
If s = "1" then
username = fixquotes(request.form("username"))
pass = fixquotes(request.form("pass"))
username = lcase(trim(username))
pass = lcase(trim(pass))
If (username="") or (pass="") then
messaggio = "Inserire tutti i dati"
Elseif InStr(username,"=") or InStr(password,"=") Then
messaggio = "Dati errati"
else
controllo = true
end if
'entro solo se passo tutti i controlli
If controllo then
set rs = server.createobject("adodb.recordset")
sqlstring = "select * from login where username='" & username & "' and pas='" & pass & "'"
'response.Write(sqlstring)
'response.End()
rs.open sqlstring, conn
If rs.eof then
messaggio = "Dati errati"
Else
' attivo le sessioni di amministrazione
session("user1") = rs("id")
%>
<%
Response.Redirect "main.asp"
response.end
End If
End If
End If
%>