<%if au<>"brit_ok" then
brit_ut = Server.HtmlEncode(request.form("UserName"))
brit_ut = request.form("UserName")
brit_ut = replace(brit_ut,"'","''")
brit_ut = replace(brit_ut,"#","''")
brit_ut = replace(brit_ut,"$","''")
brit_ut = replace(brit_ut,"%","''")
brit_ut = replace(brit_ut,"¨","''")
brit_ut = replace(brit_ut,"&","''")
brit_ut = replace(brit_ut,"'or'1'='1'","''")
brit_ut = replace(brit_ut,"--","''")
brit_ut = replace(brit_ut,"insert","''")
brit_ut = replace(brit_ut,"drop","''")
brit_ut = replace(brit_ut,"delet","''")
brit_ut = replace(brit_ut,"xp_","''")
brit_ut = replace(brit_ut,"select","''")
brit_ut = replace(brit_ut,"*","''")
brit_pas = Server.HtmlEncode(request.form("password"))
brit_pas = request.form("password")
brit_pas = Crypt(request.form("password"))
brit_pas = replace(brit_pas,"'","''")
brit_pas = replace(brit_pas,"#","''")
brit_pas = replace(brit_pas,"$","''")
brit_pas = replace(brit_pas,"%","''")
brit_pas = replace(brit_pas,"¨","''")
brit_pas = replace(brit_pas,"&","''")
brit_pas = replace(brit_pas,"'or'1'='1'","''")
brit_pas = replace(brit_pas,"--","''")
brit_pas = replace(brit_pas,"insert","''")
brit_pas = replace(brit_pas,"drop","''")
brit_pas = replace(brit_pas,"delet","''")
brit_pas = replace(brit_pas,"xp_","''")
brit_pas = replace(brit_pas,"select","''")
brit_pas = replace(brit_pas,"*","''")
if Request.ServerVariables("HTTP_COOKIE") = "" then
memo=request.form("memoria")
if memo="true" then
memoria="true"
else
memoria="false"
end if
else
memoria="false"
end if
end if
Dim brit_sql
brit_sql = "SELECT * FROM "&tabella&"Login WHERE "&tabella&"UserName='" &brit_ut&_
"' AND "&tabella&"password='" &brit_pas& "'"
Dim brit_rs
Set brit_rs = obj.Execute(brit_sql)
'response.write (brit_sql)
'response.end
Dim autenticato
if brit_rs.eof then
brit_au = false
else
brit_au = true
brit_p=brit_rs(tabella&"password")
brit_us=brit_rs(tabella&"UserName")
brit_livel =brit_rs("Clearance")
brit_conto=brit_rs("conto")
brit_id =brit_rs("id")
end if
brit_rs.Close
obj.Close
Set brit_rs = Nothing
Set obj = Nothing
if brit_au = true then
if au<>"brit_ok" then
if brit_pas=brit_p then
if memoria="true" then
dim intAnni
intAnni = 1
dim dtScadenza
Response.cookies("brit")("brit_au") ="brit_ok"
Response.cookies("brit")("memoria") ="true"
Response.cookies("brit")("Us") = brit_us
Response.Cookies("brit")("usID") = brit_id
Response.Cookies("brit")("nivel") = brit_livel
Response.Cookies("brit")("conto") = brit_conto
dtScadenza = dateAdd("yyyy",intAnni, date)
Response.cookies("brit").expires = dtScadenza
elseif memoria="fause" then
Session("brit_au") = "brit_ok"
session("clearance")=brit_livel
session("UserName")=brit_us
session("conto")=brit_conto
session("id")=brit_id
end if
end if
end if
%><%
Response.Redirect ("default.asp")
else
Response.Redirect("errore.asp")
end if
%>