473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

login page for administrator

idsanjeev
241 100+
i am using the link for administrator page .
i wants to when click on that page login page is display for checking he is administrator or not.
so what code i have to use for that.
Oct 31 '07 #1
2 2083
shweta123
692 Expert 512MB
Hi,

You can do this way ,
On Login.asp page , write this code for checking the If user is Administrator or not.

<%
Dim sql
Dim con
Dim rs
Dim username


set con = server.CreateObject("adodb.Connection")
con.connectionString = "....."
con.open

'''After checking that userName and Password are valid you will check that
if he is administrator

userName = Request.Form("txtUsername")
sql = "Select * from tablename where User = '" & userName & "'
set rs = con.execute(sql)

Dim loginType

If not rs.Eof then

''''''Get its loginType
loginType = rs.Fields("loginType")
If loginType = "Administrator" then
''''''''''''''If user is administrator
Response.Redirect("Admin.asp")
else
'''''''''''''If user is not administrator , redirect to some other page displaying Access Denied

Response.Redirect("default.asp")
end if
end if

rs.close
con.close
%>




i am using the link for administrator page .
i wants to when click on that page login page is display for checking he is administrator or not.
so what code i have to use for that.
Oct 31 '07 #2
idsanjeev
241 100+
thanks i found my result
Nov 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
3
by: Bruce | last post by:
I just started the design of an ASP.NET application which accesses one of our custom web services to provide user authentication, among other purposes. I created a log-in page (code below),...
3
by: =?Utf-8?B?QWx5?= | last post by:
User (Administrator) was some how deleted but still classed as there, though on login it does not exist. On last Microsoft update came unexpectedly just as I was shutting down as power was due to...
10
by: chirag1989 | last post by:
Hi I m makin Intranet based Library Management System On Homepage i have asked user to enter their login id and select from one option button weather he is a administrator or member.So as per...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.