产生一个密码 并记录到数据库 然后发送给用户

KR2L9F

KR2L9F

2016-01-29 19:54

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

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
%

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/asp/)

<%


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="mailid="user@ursite.com">user@ursite.com'mailid="user@ursite.com"
address="address"

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/asp/)

'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
%

展开更多 50%)
分享

猜你喜欢

产生一个密码 并记录到数据库 然后发送给用户

ASP
产生一个密码 并记录到数据库 然后发送给用户

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

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

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

创建一个带密码的空数据库

编程语言 网络编程
创建一个带密码的空数据库

delphi编程向数据库发送密码

编程语言 网络编程
delphi编程向数据库发送密码

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

创建一个空数据库

电脑网络
创建一个空数据库

从数据库中读取一个图片并保存为一个图片文件

Web开发
从数据库中读取一个图片并保存为一个图片文件

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

ASP漏洞集-MS IIS虚拟主机ASP源码泄露(MS,缺陷)

ASP漏洞集-MS IIS虚拟主机ASP源码泄露(MS,缺陷)

[Linux]输入法xsim安装方法

[Linux]输入法xsim安装方法
下拉加载更多内容 ↓