Generate a Password, record in a database and Email it by Vedachalam ManikantanThis article Generates a password random, Requires a database and Mails the Password.<%@language="vbscript" %>******************************<% 'code by Manikantan'Web Developer '3rd Agenda'Nungambakkam, Chennai India ... This article Generates a password random, Requires a database and Mails the Password.
<%@language="vbscript" %>
****************************** <% 'code by Manikantan 'Web Developer '3rd Agenda 'Nungambakkam, Chennai India %>
<% set mail= server.CreateObject("cdonts.newmail") mail.subject="Thank You for Registering" mail.to = mailid mail.from ="Webmaster@thesite" mail.body= "This is the Initial Password to our site...." & vbcrlf &href='mailto:mailid="user@ursite.com'>mailid="user@ursite.com" address="address"
'other data like phone number as per the member database in the site 'all these values are obtained from the request method from a .htm which submits to this file 'Mainly employed in registration 'Assumes You have cdonts.dll installed in the web server.
set conn = server.CreateObject("adodb.connection") conn.Open "dsn","uid","pwd" set rec= conn.Execute("select count(*) from membertable") id = cint(rec.fields(0))+1 r=rnd *50 Response.Write r & "<br>" for i = 0 to 20 if cint(r)>0 and cint(r)<26 then str=str +chr(97 + cint(r)) r=rnd *100 next
Response.Write str pwd=left(str,2) pwd=pwd & id pwd=pwd & right(str,2) pwd=pwd & second(time)
'An Update Query can be Passed from here for the username ,password and other details or can be triggered from another page 'when the user responds to the mail...Something like sending a url as a mail and on click of the url in the mail..call another page 'which updates ..so we can be sure that only confirmed users are updated
%> <br> <% set mail= server.CreateObject("cdonts.newmail") mail.subject="Thank You for Registering" mail.to = mailid mail.from ="Webmaster@thesite" mail.body= "This is the Initial Password to our site...." & vbcrlf & "Change it if You Want" & vbcrlf & pwd & vbcrlf & "Thank You for Using the Site" mail.send %>
The New Pass word has been Mailed. ******************************
Regards Vedachalam Manikantan | DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP Code Articles More By aspfree developerWorks - FREE Tools! | You'll get answers to many questions and more from David Barnes, Lead Evangelist for IBM Emerging Internet Technologies. David will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
| | | | CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP. FREE! Go There Now!
| | | | Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages. FREE! Go There Now!
| | | | Join us for this web seminar to learn how you can defend your web applications from attack. Learn about the 3 most common web application attacks, including how they occur and what can be done to prevent them. We’ll also discuss manual versus automated approaches for scanning and identifying web application vulnerabilities and how IBM Rational AppScan, an automated vulnerability scanner, can help you automate more of what you are doing manually today. FREE! Go There Now!
| | | | This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product. FREE! Go There Now!
| | | | Secure your Web applications with IBM Rational AppScan Standard Edition V7.7, previously known as Watchfire AppScan. This Web application security testing tool automates vulnerability assessments and scans and tests for common Web application vulnerabilities. Visit IBM developerWorks to download a free trial of IBM Rational AppScan Standard Edition V7.7. FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services. FREE! Go There Now!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
| | | | Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
| | | | With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |