您的位置:首页网页设计ASP实例 → 产生密码,记录到数据库,然后发送给用户。

产生密码,记录到数据库,然后发送给用户。

时间:2004/11/7 2:57:00来源:本站整理作者:蓝点我要评论(0)

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 & "
"

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



%>




<%

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.


相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 迅雷新手完全入门手册 asp下面javascript上传图片限制格式大小方法告诉大家网页弹出窗口应用总结ASP常见错误类型大全asp常见错误分析和解决办法

人气排行 总是弹出visual studio 实时调试器 三种解决SQLSERVER存储过程及调用详解Asp获取真实IP地址ASP中连接Mssql的几种方法一个简单好用的UBB编辑器(含代码)如何用Split将字符串转换为数组并获取数组下ASP防止表单重复提交的办法告诉你免费的简单聊天室源代码