Print Page | Close Window

Password protection with group ID

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=403
Printed Date: 29 March 2026 at 10:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Password protection with group ID
Posted By: judo2000
Subject: Password protection with group ID
Date Posted: 21 February 2003 at 5:49pm

I am trying to setup a password protected site.  I have the login page setup and it works against an Access database.  I have added a groupID much like in the wwForm database.  When someone logs in they are redirected to another.  Different links will appear depending on which group they are in, but I cannot figure out how to check the groupID on the second page against the login id and password.  How can I pass the username and password to the rest of the pages in the password protected area.

Any help will be appreciated.



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?



Replies:
Posted By: faubo
Date Posted: 21 February 2003 at 7:20pm

use cookies

(sorry, I have no time today)



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: judo2000
Date Posted: 21 February 2003 at 7:23pm

Thats what I thought, but the groupID is in the database and not entered at login.  How can I use the cookie to get the groupID?

Thanks



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?


Posted By: skyworld
Date Posted: 22 February 2003 at 9:47am

im the stupid 1 so dont be surprised if this dont work...

cant you just have it so if they login you do

name = request.form("name")

sql = "select * from yourdb where name like '" & name & "'"

then do something like.....

if rsportal("GROUPID") = "1" then

do what ever

else

do what ever

END IF

 

Im not sure if any of this code works but atleast im trying... practice makes perfect i hope....



Posted By: skyworld
Date Posted: 22 February 2003 at 9:50am
man am i ever having a bad spelling day had to edit that 3 times...


Posted By: faubo
Date Posted: 22 February 2003 at 10:08am

if you don't want to check the DB each page,

when you check the login vs password, the DB is open, you can write a cookie then with your ID field



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: skyworld
Date Posted: 22 February 2003 at 10:13am

IF this works....

name = request.form("name")

sql = "select * from yourdb where name like '" & name & "'"

then do something like.....

if rsportal("GROUPID") = "1" then

response.cookies("ID") = "1"

elseif rsportal("groupid") = "2" then

response.cookies("ID") = "2"

else if rsportal("groupid") = "3" then

response.cookies("ID") = "3"

else

response.cookies("ID") = "0"

END IF

 

you can do elseif as many times you want or you can use the case 1....

But if you do that then you can have at the top of your pages...

If request.cookies("ID") = "0" then

'display codes for guests or what ever zero happens to be

elseif request.cookies("ID") = "1" Then

'Show the code for this group id OR

'response.redirect "page.asp"

and u need a else then a end if or you get a error....

Please dont critisize the stupid... Not every1 is as smart as -borg- cause the chances are that i waisted my time telling you a code that will never work ...

END IF

 



Posted By: judo2000
Date Posted: 22 February 2003 at 7:54pm
I'll give these ideas a try. Thanks for the help.  I'll let you know if it works.

-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?


Posted By: judo2000
Date Posted: 24 February 2003 at 9:02am

It works.
Thanks Skyworld.  The cookie worked pretty much exactly the way you listed it above.

Thanks again!



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?


Posted By: skyworld
Date Posted: 24 February 2003 at 4:26pm

see  look maybe now and then i could actually help some one with out ******* up  

 

Any time



Posted By: MorningZ
Date Posted: 24 February 2003 at 4:36pm
Originally posted by skyworld skyworld wrote:

see  look maybe now and then i could actually help some one with out ******* up  


 


Any time


what do you want? an award or something?

-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net