I have to set up a couple pages that only allow user who has entered password and Id. How do I do it in ASP?
I know that I have to have a login screen, but have no ideas that how to passing permission thru pages
Firstly you should decide how secure you wish your pages to be. If you require a low level of security and have only a few users using a statement like:
If Request("username" = whateva AND Request ("password" = whateva Then
Response.Redirect yourpage.htm
End If
May be ok. However for extra security and if you have a large number of users you may wish to use a database connection to verify user details in which case something like the code outlined in this article should be used:
I would like to add that you can use session parameters to pass permission through pages:
If Request("username" = whateva AND Request ("password" = whateva Then
Session("Authenticated" = 1
Response.Redirect yourpage.htm
End If
Then, in every protected page, place the following code:
OK = Session("Authenticated"
If IsEmpty(OK) Then
Response.Redirect login.htm
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.