|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
please help me...
<% @ Language="JavaScript" %>
<% var DSN = "DSN=dsnZakat"; var Conn = Server.CreateObject("ADODB.Connection"); Conn.Open(DSN); var RS = Server.CreateObject("ADODB.Recordset"); var uid = Request.Form("uid"); var pwd = Request.Form("pwd"); var SQL = "Select * From users Where uid = '" + uid + "' And pwd = '" + pwd + "'"; RS.Open(SQL, Conn); //if the user is found we will set the session okeydokey to TRUE allowing the user to gain entrance if (!RS.EOF) { Session("okeydokey") = "True"; if (RS.Fields("level") == 1) { Response.Redirect("menu2.asp");//redirect to admin menu page } else { Response.Redirect("menu1.asp");//redirect to ordinary user menu page } RS = null; Conn.Close(); } else { RS = null; Conn.Close(); Response.Redirect("login.asp"); } %> above is my code at check.asp...it will check either the uid and pwd is exist in the database or not.in my database, there are 3 fields..uid,pwd and level.basically,i want to develop 1 login page with user level access that will be using by admin and ordinary user to enter the system and check.asp will authenticate the uid and pwd enter by user. if the level=1 (for admin)...the user will view his own menu page and if the level=2 (ordinary users).they also have their own menu page...but..how to check the user level stored in the database?? i have tried several codes but it didn't work...can anyone help me???please make some adjustment on my codes... |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > please help me... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|