ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Adding member services --> Part 8

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
143 active users
3103 visitors today
4666 pages today
how is this done?
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

Upgrade membership
Ugrading membership, and how I used PayPal to accept payment are the subject of a separate article, to be published soon.

To see the membership upgrade in action, why not upgrade yourself!?!

Members-only area
Providing a members-only area required very little code. First I created a function in Login.asp:

// ============================================
// make sure the user is signed in, and has sufficient access rights
// if not then redirect to passed in page
// ============================================
function NeedAccessLevel ( nLevel, sRedirect )
{
   if ( !IsLoggedIn ( ) )
      Redirect ( 'MemberLogin.asp' );

   if ( nMemberLevel < nLevel )
      Redirect ( sRedirect );
}

The function takes two parameters - the level required and a page to redirect to if the members level is lower than necessary.

Here's how I use it in the exclusive member-only pages - add this code to the top of the page, before the call to Init(), in case the function redirects the user:

// need signed in members of level 2 and above
NeedAccessLevel ( 2, 'MemberUpgrade.asp' );

See what I mean by trying to access a test page that is only available to Gold members - TestAccess.asp.

There's too much code to list, but you can download everything by clicking on the icon.

Featured sponsor
My favorite resources

Selling products online - read how James does it now



See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!