Upgrade membershipUgrading 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 areaProviding 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.
|