%
If Request.Form("Action") = "Login" Then
strUID = Trim(Replace(Request.Form("Brugernavn"),"'",""))
strPWD = Trim(Replace(Request.Form("Adgangskode"),"'",""))
If Len(strUID) > 0 And Len(strPWD) > 0 Then
'Username=setupUserName
'Password=setupPassword
dim RS, SQL
set RS = server.createobject("ADODB.recordset")
SQL = "SELECT * FROM Brugere WHERE brugerUserName='"&strUID&"' AND brugerPassword='"&strPWD&"' AND brugerIsAdmin = true"
RS.Open SQL,conn
if not RS.eof then
if RS("brugerIsAdmin") then
Session("superAdm")=true
end if
intUID = RS("brugerID")
else
strERR = "DUER IKKE!!"
end if
RS.close
set RS = nothing
'if (Username = strUID AND Password = strPWD) then
' intUID = Username
'Else
' strERR = "DUER IKKE!!"
'End If
If Len(intUID) Then
Session("UserID") = intUID
response.Redirect("spiller.asp")
End If
Else
strErr = "Du skal skrive både brugernavn og
adgangskode."
End If
If Len(strErr) > 0 Then
strErr = "
" & strErr & "
" End If End If %>|
<%=strErr%> |