salve vi posto il codice asp di verifica per il login in cui ho implementato la fixsql.
potete gentilmente dirmi se lho implementata in modo corretto?
grazie
<%
Function FixSQL(stringa)
stringa = Replace(stringa, "'", "''")
stringa = Replace(stringa, "%", "[%]")
stringa = Replace(stringa, "[", "[[]")
stringa = Replace(stringa, "]", "[]]")
stringa = Replace(stringa, "_", "[_]")
stringa = Replace(stringa, "#", "[#]")
FixSQL = stringa
End function
Dim nome_ut
Dim pass
nome_ut = fixsql(Request.Form("nome_utente"), "'", "''")
pass = fixsql(Request.Form("password"), "'", "''")
Dim cn
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("xx.mdb")
Dim sql
sql = "SELECT ID FROM Utenti WHERE NOMEUTENTE='" &nome_ut&_
"' AND PASSWORD='" &pass& "'"
Dim rs
Set rs = cn.Execute(sql)
Dim xx
if rs.eof then
xx = false
else
xx = true
end if
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
if xx = true then
Session("xx") = "OK"
Response.Redirect("xx.asp")
else
Response.Redirect("xx.htm")
end if
%>