Wife/Girlfriend/Sister?
Pepper Spray &
Stun Gun Specials!
KEEP THEM SAFE.
 CoverYourASP --> Adding member services --> Part 5

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
125 active users
1843 visitors today
2277 pages today
(only part of today)
Tools I use

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

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Forgotten passwords
Sending passwords via email was very simple, although, yet again, a little unsecure. A form asks for the members email address, looks that up in the database and emails the password.

Here's the "essence" of the code that does all that:

DBInitConnection ( );

DBGetRecords ( 'SELECT Name,MemberPassword FROM Members WHERE Email=\'' + sEmail + '\'' );

if ( !oRecordSet.EOF )
{
   // get data from recordset
   sName = '' + oRecordSet ( 0 );
   sPassword = '' + oRecordSet ( 1 );

   var sBody = 'Dear ' + sName + '\n\n';

   sBody += 'Your password is: ' + sPassword+ '\n\n';
   sBody += 'Regards,\n';
   sBody += 'MemberServices@CoverYourASP.com\n';

   // send Email with our generic function
   SendEmail ( 'MemberServices@' + sHostDomain, sEmail, '', 'Lost Password', sBody );
}

// release the database connection ASAP
DBReleaseConnection ( );

Part 6: Membership levels...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!


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

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