程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程問題解答 >> 如何取回已忘記的密碼?

如何取回已忘記的密碼?

編輯:編程問題解答

forget.asp

' 申請.

<html>

<head>

<title>閃亮日子之用戶密碼核實</title>

</head>

<div align="center"><center>

<table border="0" cellspacing="0" width="600" height="158" >

  <tr>

    <td height="67"><p align="center">閃亮日子<br>

    用戶密碼核實</td>

  </tr>

  <tr>

    <td height="63"><p align="center"><font color="#0000FF">請正確填寫您的郵件地址,我們會在核實後,盡快將密碼寄給您!</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

' 確認.

<%@ LANGUAGE="VBscript" %>

<% Option Explicit %>

<%

Dim DATA_PATH, objDC, objRS, email, user, pass, sendmail

DATA_PATH=Server.Mappath("users.mdb")

' 打開數據庫.

 

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

' 校驗用戶的信箱是否存在.

%>

 

<html>

<head>

<title>山水盈盈之郵件地址錯誤提示</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>

    郵件地址錯誤提示</font></td>

  </tr>

  <tr>

    <td height="37"><b><font color="red"><p align="center">對不起,該用戶郵件信箱:<%=email%>不存在!

    </font></b></td>

  </tr>

</table>

</center></div>

</body></html>

</font></B>

<% Else %>

 

<%

email = request.form("email")

' 從數據庫中選取與遞交的信箱對應的帳號,密碼.

user = objrs.Fields("username")

pass = objrs.Fields("password")

Set sendmail = Server.CreateObject("CDONTS.NewMail")

sendmail.From = [email protected]

' 網管信箱.

sendmail.To = email

sendmail.Subject = "您的登錄信息,請保存好!"

' 郵件主題.

sendmail.body = "您在山水盈盈的登錄資料是:" & vbCrlf & vbCrlf _

& "Username=" & user & vbCrlf _

& "Password=" & pass & vbCrlf

' 郵件內容.

sendmail.Importance = 2

sendmail.Send

%>

您的資料已發送到<%=email%>,請收好,歡迎再次光臨!<br>

<%

    objDC.Close

Set objRS =  Nothing

Set objDC = Nothing

Set sendmail = Nothing

%>

<%end if%>

[1]

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved