Hi Jerry,
I was illustrating some of the concepts I use - myuserLevel (per page) and userlevel (per user) in general. I use them as a way of showing or hiding pages, menu items and other things based on a user's rights. For example on corporate intranets, managers would have a higher user level and would see items that other staff members can not.
For your purposes, you don't really need to use user levels, you simply need to check if one session variable is set, I guess for you this would be the user's ID.
So your logged.asp page, the one that verifies the user's details, would set the variable after it has found their details.
One way would be to split the logged page into two. One that logs them in and one that shows them their profile, and then make that page and the edit page redirect them to the login one if they are not logged in.
So at the top of the two profile pages:
-
If session("somevariable") = "" Then
-
response.redirect("loginpage.asp")
-
End If
-
...rest of content
-
You may also want to think about combining the login page with the logged one.
Think of it this way: If the user was just on this page, and he pressed submit, bttnSubmit would = "Submit" in the querystring. If that is the case, process their login, otherwise show them the login form, whose action is the same page.
This can also apply to combining the profile pages into one, too.
Structured like this:
Select statement.
Check status of submit -> if = "submit"
..
..
rs("somevariable") = somevariablefrompost
rs.update
redirect to this page.
Else
Form whose action equals this page.
fields populated with values from recordset.
End If
Maybe that's a bit too much info at this point!
Gaz.