这 是一端找回个人密码的代码 ,要求先输入注册过的用户名 ,才能显示下面2的区域获得密码问题,不然显示上面1的区域。然而我实验了多次,无论我填写的用户名是否正确 ,都只显示1的区域 错在那里呀?
1
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/com.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "name"
If (Request("MM_EmptyValue") <> "") Then
Recordset1__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_com_STRING
Recordset1.Source = "SELECT * FROM user WHERE name = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
<body>
<p> </p>
<p>
<% If Recordset1.EOF And Recordset1.BOF Then %>
你不是注册用户 ,或填写错误 ---------------<a href="a.asp">返回</a>
<% End If ' end Recordset1.EOF And Recordset1.BOF %>
</p>
<p> </p>
2
<form id="form1" name="form1" method="post" action="c.asp">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<p>您的密码问题是<%=(Recordset1.Fields.Item("wenti").Value)%>
<input name="hiddenField" type="hidden" value="<%=(Recordset1.Fields.Item("wenti").Value)%>" />
</p>
<p>请填写密码答案
<label>
<input name="textfield" type="text" size="10" maxlength="10" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="提交" />
</label>
</p>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</form>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
[此贴子已经被作者于2006-5-23 22:36:55编辑过]