Results 1 to 2 of 2

Thread: Help

  1. #1
    Jam Guest

    Default Help

    On login page i need to check if the user has the privileges to modify or add if yes then it should redirect to other asp if not it should redirect to other asp for this i had taken three fields in database username,passwors,privil so for e.g is username is bob and password is bob and it has priviliges then allow him to enter otherwise throw a error message.I am placing code here please look at it and give me the sugguestion what to do.<BR><BR>&#060;%<BR>char=aa<BR>if request.form("a1") &#060;&#062; "" then<BR>Set Con = Server.CreateObject("ADODB.Connection")<BR>Con.Ope n "DSN=test"<BR>SET RS = Server.CreateObject("ADODB.Recordset")<BR>RS.Curso rType = adOpenStatic<BR>RS.Open "Select username, password from TEST where username = &#039" & request.form("a1") & "&#039 and password = &#039" & request.form("a2") & "&#039", Con<BR>RS.Open "Select Privil from TEST where Privil &#039" & aa" &"&#039<BR>if RS.EOF then<BR> response.write "&#060;p&#062;incorrect logon credentials supplied ! &#060;/P&#062;"<BR>else<BR> RS.Close<BR> Con.Close<BR> response.redirect "Interface.asp"<BR>end if<BR>RS.Close<BR>Con.Close<BR>end if<BR>%&#062; <BR>Thanks & Regards<BR>Bob

  2. #2
    Join Date
    Dec 1969

    Default RE: Help

    Bob,<BR><BR>Looks as if you may have forgotten the &#039=&#039 in the line<BR><BR>RS.Open "Select Privil from TEST where Privil &#039" & aa" &"&#039<BR><BR>so it reads<BR><BR>RS.Open "Select Privil from TEST where Privil=&#039" & aa" &"&#039<BR><BR>Hope this helps<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts