Creating a members area with ASP - The members area
(Page 5 of 6 )
We aren't going to waste any time giving you ideas on what you can put in your members area; that's up to you. The only bit of code you need to include in all your members pages is a section to check if the user is logged in or not. If they aren't, then they are automatically redirect to the login page:
<% If Session("loggedin") <> True
Then Response.Redirect "login.asp" %>
<html>
<head>
<title>Members Area</title>
</head>
<body>
<h1>Members Area</h1>
<p>Welcome to our members area!</p>
</body>
</html> and that's it! A few things to note...
- If you try to access default.asp before you have logged in then you won’t be able to.
- Once you have logged in, if you visit login.asp again, you will automatically be logged out. So, if you want a 'Log Out' link in the member’s area, simply link to login.asp
And that's it! You now have your very own members area!
Next: Conclusion >>
More ASP Articles
More By James Crowley