ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Removing unconfirmed members --> Part 3

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
307 active users
1861 visitors today
2816 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!

The RemindMembers function

function RemindMembers ( )
{
   // todays date
   var dCutoff = new Date;
   var nDate = dCutoff.getDate ( ) - 9;

   dCutoff.setDate ( nDate + 1 );

   DBInitConnection  ( );

   DBGetRecords ( 'SELECT MemberID,Email,Name,LastVisit FROM Members WHERE Confirmed=False AND LastVisit<=' + DBWrapDate ( FormatDateDMY ( dCutoff ) ) );

I started by getting today's date and setting dCutoff and dEmail to 10 and 11 days earlier respectively. I then opened the database and queried it for all records in the Members table that had been unconfirmed for that long.

The simple loop below then went through each record in turn, and either emailed the user that he had one day left to confirm his membership, or deleted the record.

I'll show you the details of those two processes in the next few pages.

while ( !oRecordSet.EOF )
{
   var nID = oRecordSet ( 0 ) - 0;
   var dDate = new Date ( oRecordSet ( 3 ) );

   // either send an email, or delete them..
   if ( dDate.getDate ( ) == nDate )
   {
      // send email
   }
   else
   {
      // delete them
   }

   oRecordSet.moveNext ( );
}

Part 4: Emailing a reminder...

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!