phentalmyst
Programmer
hi all, im working on an asp app that works like so:
a user logs in through a simple form..and the screen the are directed to depends on if they are a user or an administrator. the usernames and passwords for the users and admins are in 2 different sql tables and i have the query string correct. the problem is, i dont know how to say "ok, if the user is from the admin table, go here, if he's from the users, go here, and if he's from neither, go here."
this is what i have so far. i greatly appreciate ANY help!
----------
KC_valUsername=CStr(Request.Form("userid")
KC_valPassword=CStr(Request.Form("password")
KC_adminSuccess="admin.asp?adminid=" & KC_valUsername
KC_userSuccess="clients.asp?userid=" & KC_valUsername
KC_loginFailed="failed.asp"
Set KC_loginInfo = Server.CreateObject("ADODB.Recordset"
KC_loginInfo.ActiveConnection = KC_USIS_STRING
SQL = "SELECT aUserid, aPassword, uUserid, uPassword from Admins, Users WHERE aUserid='" & KC_valUsername &"' AND aPassword='" & KC_valPassword & "' OR uUserid='" & KC_valUsername &"' AND uPassword='" & KC_valPassword & "'"
KC_loginInfpen SQL
If Not KC_loginInfo.EOF Or Not KC_loginInfo.BOF Then
Session("KC_Username" = KC_valUsername
If (KC_fldUserAuthorization <> "" Then
Session("KC_UserAuthorization" = CStr(KC_loginInfo.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("KC_UserAuthorization" = ""
End If
If CStr(Request.QueryString("accessdenied") <> "" And false Then
KC_userSuccess = Request.QueryString("accessdenied"
End If
KC_loginInfo.Close
Response.Redirect(KC_adminSuccess)
End If
----------
a user logs in through a simple form..and the screen the are directed to depends on if they are a user or an administrator. the usernames and passwords for the users and admins are in 2 different sql tables and i have the query string correct. the problem is, i dont know how to say "ok, if the user is from the admin table, go here, if he's from the users, go here, and if he's from neither, go here."
this is what i have so far. i greatly appreciate ANY help!
----------
KC_valUsername=CStr(Request.Form("userid")
KC_valPassword=CStr(Request.Form("password")
KC_adminSuccess="admin.asp?adminid=" & KC_valUsername
KC_userSuccess="clients.asp?userid=" & KC_valUsername
KC_loginFailed="failed.asp"
Set KC_loginInfo = Server.CreateObject("ADODB.Recordset"
KC_loginInfo.ActiveConnection = KC_USIS_STRING
SQL = "SELECT aUserid, aPassword, uUserid, uPassword from Admins, Users WHERE aUserid='" & KC_valUsername &"' AND aPassword='" & KC_valPassword & "' OR uUserid='" & KC_valUsername &"' AND uPassword='" & KC_valPassword & "'"
KC_loginInfpen SQL
If Not KC_loginInfo.EOF Or Not KC_loginInfo.BOF Then
Session("KC_Username" = KC_valUsername
If (KC_fldUserAuthorization <> "" Then
Session("KC_UserAuthorization" = CStr(KC_loginInfo.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("KC_UserAuthorization" = ""
End If
If CStr(Request.QueryString("accessdenied") <> "" And false Then
KC_userSuccess = Request.QueryString("accessdenied"
End If
KC_loginInfo.Close
Response.Redirect(KC_adminSuccess)
End If
----------