Creating a Members Area in ASP

The members area

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 page is a section to check if the user is logged in or not. If they aren't you automatically redirect to the login page:

default.asp

<%
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...

1) if you try to access default.asp before you have logged in :- you can't!
2) 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 members area, simply link to login.asp

And that's it! Your very own members area.

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The generation of random numbers is too important to be left to chance.” - Robert R. Coveyou