注册 登录
编程论坛 ASP技术论坛

高手指点下哪里出错了

dzxiaojie 发布于 2010-03-05 00:57, 699 次点击

输入不存在的账号提交时  不提示账号不存在 而是无法显示



<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="adoconn.asp"-->
<!--#include file="md5.asp"-->
<%
username=trim(Request.Form("username"))
jpassword=md5(trim(Request.Form("jpassword")))
password1=trim(Request.Form("password1"))
password2=trim(Request.Form("password2"))
password=md5(password2)
if password1=password2 then
sql="select DISTINCT F_Password from T_usercore where F_username='"&username&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
  if rs.eof then
    response.write "账号不存在!"
    rs.close
    set conn=nothing
  else
   if UCase(rs("F_Password"))=jpassword then
    conn.execute("update T_usercore set F_Password='"&password&"' where F_username='"&username&"'")
    response.write "密码修改成功!<br>"
    response.write "你的账号为:"&username&"<br>"
    response.write "新 密 码为:"&password1&"</font><br>"
    response.write "请妥善保管好自己的账号密码,如有丢失,GM不负任何责任!"
   else
    response.write "密码错误!"
   end if
  end if
 rs.close
 set conn=nothing
else
response.write "两次次输入的新密码不一致!"
end if
 %>

[ 本帖最后由 dzxiaojie 于 2010-3-5 00:59 编辑 ]
5 回复
#2
yms1232010-03-05 10:49
无法显示出现错误页面了?用的是什么数据库?
#3
dzxiaojie2010-03-05 13:44
以下是引用yms123在2010-3-5 10:49:12的发言:

无法显示出现错误页面了?用的是什么数据库?
是的  我用的sql2000
#4
yms1232010-03-05 22:05
把错误页面的所有内容能发上来吗?我指的是报错的系统报错信息。
#5
qpjiangjie2010-03-06 14:53
top.asp 文件如下:
<link href="css.css" rel="stylesheet" type="text/css">
<table width="960" height="85" border="0" cellpadding="0" cellspacing="0" align="center">
      <tr>
        <td width="68%" align="left">
        <table border="0" cellPadding="0" cellSpacing="0" width=700 height=66 align=center
>
<tr>
<TD width=700 height=66 background="../images/logo1.jpg"><EMBED pluginspage=http://www.
src="15.swf"   width=700 height=66
type=application/x-shockwave-flash wmode="transparent"
quality="high"></EMBED></TD><tr></table>   

        </td>
        
        <td width="32%" align="right"><iframe src="http://m. " width="150" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="No"></iframe></td>
      </tr>
    </table>
      <table width="960" border="0" cellpadding="0"  cellspacing="0"  align="center">
      <tr>
        
          <td width="24%"><div style="padding-bottom:6px; color:#000000">
<script src="include/date.js" type=text/javascript></script> <span id="time"></span>    <script>setInterval("time.innerHTML=new Date().getHours()+':'+new Date().getMinutes()+':'+new Date().getSeconds()",1000);</script>
       </div></td>
          <td width="74%">
         
          <table width="100%" height="29" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td>               
              <!--#include  file="21.html" -->
               </td>
            </tr>
        </table></td>
        </tr>
    </table>


图片下带 flash效果

但是将这个文件包含到他的上级目录下的一个文件下top2.asp
怎么都不显示了啊
top2.asp 如下:

<html xmlns="http://www.
<head>
<title>无标题文档</title>
</head>

<body>
<!--#include  file="include/top.asp" -->
</body>
</html>
#6
dzxiaojie2010-03-07 05:08
自己解决了

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="adoconn.asp"-->
<!--#include file="md5.asp"-->
<%
username=trim(Request.Form("username"))
jpassword=md5(trim(Request.Form("jpassword")))
password1=trim(Request.Form("password1"))
password2=trim(Request.Form("password2"))
password=md5(password2)
if password1=password2 then
sql="select DISTINCT F_Password from T_usercore where F_username='"&username&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
  if rs.eof then
    response.write "账号不存在!"
    rs.close //这句去掉了 就可以了   
    set conn=nothing
  else
   if UCase(rs("F_Password"))=jpassword then
    conn.execute("update T_usercore set F_Password='"&password&"' where F_username='"&username&"'")
    response.write "密码修改成功!<br>"
    response.write "你的账号为:"&username&"<br>"
    response.write "新 密 码为:"&password1&"</font><br>"
    response.write "请妥善保管好自己的账号密码,如有丢失,GM不负任何责任!"
   else
    response.write "密码错误!"
   end if
  end if
rs.close
set conn=nothing
else
response.write "两次次输入的新密码不一致!"
end if
%>
1