<% SET RS = Server.CreateObject("ADODB.Connection") RS.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("security.mdb") If Request("mode") = "Check" then Function unQuote(strTekst) strTekst = Trim(strTekst) unQuote = Replace(strTekst,"%","53") End Function strUsername = unQuote(request("username")) strPassword = unQuote(request("password"))
Sql = "Select Count(*) as Found from user where (username = '" & strUsername & "') and (password ='" & strPassword & "')" Set LO = RS.Execute(Sql) if LO("Found") = 0 then Session("login") = "" error = "Du blev ikke godkendt af systemet" else strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("security.mdb") Set conn = Server.CreateObject("ADODB.Connection") conn.Open strDSN strSQL = "SELECT * FROM user where (username = '" & Request("username") & "') and (password ='" & Request("password") & "')" Set ez = conn.Execute(strSQL) Session("login") = "loggetind" Response.Redirect "admin.asp" EZ.Close RS.Close Conn.Close end if end if %>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.