|
|
|
产生一个密码记录并发送给用户 |
|
|
| http://www.iyit.net 日期:2005-11-24 17:47:52 来源:易特网络技术 点击: |
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 %>
|
上一篇:从数据库中动态选取下拉列表的方法
下一篇:没有了
[发送给好友] [打印本页] [关闭窗口] [返回顶部] 转载请注明来源:http://www.iyit.net |
|
| 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 责任编辑: |
投稿作者: 易特网络技术 |
| 信息来源: 易特网络技术 |
录入时间: 2005-11-24 17:47:52 |
| 浏览次数: |
投稿信箱: shtghy@163.com |
|
|
|
|
|