ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 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
110 active users
2689 visitors today
4787 pages today
how is this done?
Tools I use

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


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...