| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 704 人关注过本帖
标题:产生一个密码,并记录到数据库,然后发送给用户
只看楼主 加入收藏
hellode
Rank: 2
等 级:论坛游民
帖 子:161
专家分:16
注 册:2007-3-29
结帖率:80%
收藏
 问题点数:0 回复次数:1 
产生一个密码,并记录到数据库,然后发送给用户
--------------------------------------------------------------------------------


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@'>mailid="user@
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
%>
搜索更多相关主题的帖子: 数据库 密码 用户 记录 
2008-08-20 10:48
awke002
Rank: 2
等 级:论坛游民
帖 子:201
专家分:55
注 册:2008-7-22
收藏
得分:0 
这个密码是终身制的么
还是只是第一次注册的时候,系统随机生成的密码。
用登陆了以后应该可以修改自己的密码了吧!
2008-08-20 10:57
快速回复:产生一个密码,并记录到数据库,然后发送给用户
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017290 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved