Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 13th, 2004, 07:50 PM
wackyflik's Avatar
wackyflik wackyflik is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Malaysia
Posts: 312 wackyflik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 13 h 16 m 40 sec
Reputation Power: 4
Send a message via Yahoo to wackyflik
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...

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > please help me...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway