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
18 active users
26 visitors today
94 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2012 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



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

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


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...