473,395 Members | 1,726 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,395 software developers and data experts.

ASP/Access Password Protection for Multiple Pages

Hello,

First, I apologize for what's probably a novice question, but I haven't been able to find this specific issue previously addressed.

I've successfully set up a password-protected webpage using ASP and an Access DB, as outlined in MS KB article 825498. I want to repeat this process for another page/subweb in the site referencing a different DB and include file, but the problem is after logging into one of the secure pages that same user session seems to still be good for access to the other page. How can I make them mutually exclusive?

If anyone can point me in the right direction to resolving this issue I would greatly appreciate it!

Thanks,
Knouphis
Jul 15 '08 #1
2 2538
idsanjeev
241 100+
Hello knouphis
welcome to bytes forum
you try to block user for some pages after login one time your need to repeat this process for another page/subweb in the site referencing a different DB and include file then open a new login page refrencing to databse and store it in different session then chek if session("user2") is not null then proceed otherwise redirect to another login page refrencing new database.
whats you are doing for thats
Regards
Jha
Jul 15 '08 #2
danp129
323 Expert 256MB
You need to have the access database store permissions for what access that user can do. If you are only going to have a few types such as an admin user and a basic user then I would add a number field called user_type and say if user_type is 1 then they are a basic user, if 255 then they are an admin.

When the login script is called it checks the field for that user/pass. If it is 1 then set session("blnIsUser")=true. If it is 255 then set session("blnIsAdmin")=true as well as blnIsUser.

When you have a page you want to protect that only logged in users can get to, do:
if not session("blnIsUser")=true then response.redirect "logon.asp"

For pages only an admin should see do
if not session("blnIsUser")=true then response.redirect "logon.asp"



You may also want to keep track of what they're last page was before redirecting them to the login script, so they can return automatically after they login. You would put something like this in your protected page:

Expand|Select|Wrap|Line Numbers
  1. if not session("blnIsUser")=true then 
  2.     session("URL")=Request.ServerVariables("SCRIPT_NAME") & "?" & Request.ServerVariables("QUERY_STRING")
  3.     Response.Redirect "logon.asp"
  4. end if
Then do this in your login page after you have verified their username/password and set the appropriate session variables:

Expand|Select|Wrap|Line Numbers
  1. if session("URL") <> "" then
  2.     response.redirect=session("URL")
  3. else
  4.     response.redirect "/"
  5. end if
Jul 22 '08 #3

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

Similar topics

3
by: Wm | last post by:
Something just occurred to me... <yeah, I know, it scared me too> I just password-protected a website by including a password authentication script in each page of a private section. The script...
6
by: Lou | last post by:
Please can someone put me out my misery! Im trying to find a multiple user/password protection script that will redirect the specific user to a specific directory. At the moment I have set up...
7
by: Eagle35 | last post by:
any one now any good java/Html for password pages so i can protect some pages?? Thanks
2
by: chris | last post by:
Hi, I will be looking to use gatekeeper or some other javascript method of password protection but... Once there I need a way of resticting access to a page to stop someone from bookmarking...
7
by: Borked Pseudo Mailed | last post by:
Seeking feedback on Password Protection via Java/JavaScript ONLY (no cgi): SEE: http://online_tools.home.att.net/tools.html *AND* http://online_tools.home.att.net/extraCode.htm Thanks.
1
by: John Michael | last post by:
I have created some password routines to protect certain forms from access without a password. This allows me to create some security for apps that will be used on diff machines for users that...
6
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by...
12
by: Dr. Edmund M. Hayes | last post by:
I wrote a access program that works well enough that a handful of people would like to buy it from me. My problem is that if I sell it to someone there is no mechanism that I know of to protect...
22
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.