| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 699 人关注过本帖
标题:高手指点下哪里出错了
只看楼主 加入收藏
dzxiaojie
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2009-1-30
结帖率:11.11%
收藏
 问题点数:0 回复次数:5 
高手指点下哪里出错了

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



<%@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 编辑 ]
搜索更多相关主题的帖子: 936 password include where file 
2010-03-05 00:57
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
无法显示出现错误页面了?用的是什么数据库?
2010-03-05 10:49
dzxiaojie
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2009-1-30
收藏
得分:0 
以下是引用yms123在2010-3-5 10:49:12的发言:

无法显示出现错误页面了?用的是什么数据库?
是的  我用的sql2000
2010-03-05 13:44
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
把错误页面的所有内容能发上来吗?我指的是报错的系统报错信息。
2010-03-05 22:05
qpjiangjie
Rank: 1
等 级:新手上路
帖 子:10
专家分:2
注 册:2010-3-4
收藏
得分:0 
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>
2010-03-06 14:53
dzxiaojie
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2009-1-30
收藏
得分:0 
自己解决了

<%@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
%>
2010-03-07 05:08
快速回复:高手指点下哪里出错了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014953 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved