When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Graphic Designer / Web Designer / Graphic Artist
Next Step Systems
US-IL-Des Plaines

Justtechjobs.com Post A Job | Post A Resume

Published: Sunday, April 30, 2000

Emailing Users their Forgotten Passwords
By Eric Coffman


A few months ago I decided it was time to learn ASP. I started out using some code samples from around the web, and eventually learned to write some of it myself. I recently read Sams Teach Yourself Active Server Pages 3.0 in 21 Days which helped me clean up my coding techniques.

- continued -

I work at a large university that has many online courses. Due to the creation time involved in preparing an entire course for the net, and to keep others from plagiarizing the material, we password protect much of the content. We use an access database to keep all students names, email addresses, usernames, and passwords that are enrolled in the particular class and have them log in to the the courses with that information. Although this method works quite well to allow only the members of a particular class access to the course material, the students, especially at the start of a semester, often forget their login information. Last semester I decided it was time to stop the "I forgot my password" emails, and wrote this script.

I use the CDONTS component that comes with IIS to do the sending. (For a good article on CDONTS, check out: Sending Email Using CDONTS.) Basically what happens is a person who has forgotten their login information is directed to a page that asks for their email address. The page posts the entered email address to a second page which checks if the email address entered is in the database. If the email address is not there, the user will be prompted as such. If the email address is there, the script sends an email to the address entered with the username and password for that person in the message body. We assume that your user database has a username, password, and an email field and the database table is called USERS. Now that we know what we are doing lets see how.

The first page, forgot.asp is just a basic form that gathers a users email address and posts it to sendit.asp. Keep in mind there is no error checking here, you may want to add that to avoid apostrophe problems.

<html>
<head>
  <title>Forgot Password?</title>
</head>
<body>
If you forgot your login information, enter you email
address below and it will be sent to you.

<form method="POST" action="sendit.asp">
  Your email address:
  <input type="text" name="email" size="20">
  <input type="submit" value="Request information">
</form>
</body>
</html>

The second page, sendit.asp is what actually does the work. We'll look at the source code for SendIt.asp in detail in Part 2.

  • Read Part 2


    Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article

  • internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info

    Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

    Whitepapers and eBooks

    Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
    IBM Solutions Brief: Go Green With IBM System xTM And Intel
    HP eBook: Simplifying SQL Server Management
    IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
    Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
    Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
    Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
    Intel PDF: Quad-Core Impacts More Than the Data Center
    Intel PDF: Virtualization Delivers Data Center Efficiency
    Go Parallel Article: PDC 2008 in Review
    Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
    Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
    Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
      PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
    Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
    Go Parallel Article: Q&A with a TBB Junkie
    IBM Whitepaper: Innovative Collaboration to Advance Your Business
    Internet.com eBook: Real Life Rails
    IBM eBook: The Pros and Cons of Outsourcing
    Internet.com eBook: Best Practices for Developing a Web Site
    IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
    Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
    IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
    Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
    HP eBook: Guide to Storage Networking
    MORE WHITEPAPERS, EBOOKS, AND ARTICLES