Re: ASP Login Script not working
From: Bullschmidt (paul_at_bullschmidt.com-nospam)
Date: 06/22/04
- Next message: Bullschmidt: "Re: ASP Question (Newbie)"
- Previous message: Bullschmidt: "Re: Whats the most secure way of password protecting pages?"
- In reply to: Wayne Smith: "ASP Login Script not working"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Jun 2004 22:41:39 -0700
Yes there seem to be a lot of problems with that code.
In login.asp since nextpage is never set the URL is something like
register.asp?nextpage=:
<<
<a href="register.asp?nextpage=<%server.urlencode( nextpage )%>">
Click here to register</a>
>>
There is no code in any of the 3 pages that actually writes to the
database.
In checkpassword.asp included file there is not End Function at the end
or the %> end of ASP end tag.
And by the way here is a simple overview of how I deal with the login of
an already registered user.
Perhaps have a login page that asks the user for his username and
password. And whatever page that posts to (which could be the same page
for a self posting form) tests these fields against what is in the
database, sets the username and userlevel session variables accordingly,
and then redirects to the proper page - i.e. back to the login page if
the password is wrong (perhaps with a JavaScript popup saying wrong
username/password combination) or to the main menu page if the password
is correct:
Session("UserName") = objRS("UserName")
Session("UserLevel") = objRS("UserLevel")
Response.Redirect "mainmenu.asp"
Then you can use If Then's or Select Case on each page to control
whether a user is allowed to actually be there and whether particular
links of where a user can go actually show up.
If (Session("UserLevel") <> "Admin") And (Session("UserLevel") <>
"Regular") Then
Response.Redirect "login.asp"
End If
Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Bullschmidt: "Re: ASP Question (Newbie)"
- Previous message: Bullschmidt: "Re: Whats the most secure way of password protecting pages?"
- In reply to: Wayne Smith: "ASP Login Script not working"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|