forget.asp
' 申請(qǐng).
html>
head>
title>閃亮日子之用戶(hù)密碼核實(shí)/title>
/head>
div align="center">center>
table border="0" cellspacing="0" width="600" height="158" >
tr>
td height="67">p align="center">閃亮日子br>
用戶(hù)密碼核實(shí)/td>
/tr>
tr>
td height="63">p align="center">font color="#0000FF">請(qǐng)正確填寫(xiě)您的郵件地址,我們會(huì)在核實(shí)后,盡快將密碼寄給您!/font>/p>
form method="POST" action="sendit.asp">
div align="center">center>p>您的郵件地址: input type="text" name="email"
size="20" style="font-size: 12pt"> input type="submit" value="確定"
style="font-size: 12pt"> /p>
/center>/div>
/form>
/td>
/tr>
/table>
/center>/div>
/body>/html>
sendit.asp
' 確認(rèn).
%@ LANGUAGE="VBscript" %>
% Option Explicit %>
%
Dim DATA_PATH, objDC, objRS, email, user, pass, sendmail
DATA_PATH=Server.Mappath("users.mdb")
' 打開(kāi)數(shù)據(jù)庫(kù).
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.ConnectionTimeout = 15
objDC.CommandTimeout = 30
objDC.Open "DBQ=" DATA_PATH ";Driver={Microsoft Access Driver (*.mdb)}; DriverId=25;MaxBufferSize=8192;Threads=20;", "admin", "password"
Set objRS = Server.CreateObject("ADODB.Recordset")
email=request.form("email")
objRS.Open "select * from USERS WHERE email = '" email "'", objDC, 0, 1
' 校驗(yàn)用戶(hù)的信箱是否存在.
%>
html>
head>
title>山水盈盈之郵件地址錯(cuò)誤提示/title>
/head>
body>
%
if objrs.EOF then
%>
b>font color="red">
/font>/b>div align="center">center>
table border="0" cellspacing="0" width="600" height="100" >
tr>
td height="64">p align="center">山水盈盈br>
郵件地址錯(cuò)誤提示/font>/td>
/tr>
tr>
td height="37">b>font color="red">p align="center">對(duì)不起,該用戶(hù)郵件信箱:%=email%>不存在!
/font>/b>/td>
/tr>
/table>
/center>/div>
/body>/html>
/font>/B>
% Else %>
%
email = request.form("email")
' 從數(shù)據(jù)庫(kù)中選取與遞交的信箱對(duì)應(yīng)的帳號(hào),密碼.
user = objrs.Fields("username")
pass = objrs.Fields("password")
Set sendmail = Server.CreateObject("CDONTS.NewMail")
sendmail.From = webmaster@intels.net
' 網(wǎng)管信箱.
sendmail.To = email
sendmail.Subject = "您的登錄信息,請(qǐng)保存好!"
' 郵件主題.
sendmail.body = "您在山水盈盈的登錄資料是:" vbCrlf vbCrlf _
"Username=" user vbCrlf _
"Password=" pass vbCrlf
' 郵件內(nèi)容.
sendmail.Importance = 2
sendmail.Send
%>
您的資料已發(fā)送到%=email%>,請(qǐng)收好,歡迎再次光臨!br>
%
objDC.Close
Set objRS = Nothing
Set objDC = Nothing
Set sendmail = Nothing
%>
%end if%>
[1]