<%
Option Explicit
dim conn,DBPath
dim rs1
dim sql1
dim username
dim mail
dim lkz
dim connstr
username=request("username")
mail=request("mail")
lkz="../db/m#lkz.mdb"
set conn=server.createobject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath(lkz)
conn.open connstr
Set rs1= Server.CreateObject("ADODB.Recordset")
sql1="select * from [user] where [username] like '" & username & "' "
rs1.open sql1,conn,3,2
%>
<%if rs1.eof and rs1.eof then%>
<font color=red class="titletext">没有该用户的记录!</font> <br><br>
<%else%>
……………………………………
<%end if%>
我想再上面再填加一个判断,
如果mail=request("mail")不等于<%=rs1("email")%>
则显示 <font color=red class="titletext">电子邮件地址错误!</font>
具体代码应该怎么写????????
參考答案:<%if rs1.eof and rs1.eof then%>
<font color=red class="titletext">没有该用户的记录!</font> <br><br>
<%elseif request("mail")<>rs1("email") then%>
<font color=red class="titletext">电子邮件地址错误!</font>
<%else%>
.............
<%end if%>