中国网管论坛's Archiver

kos 发表于 2006-12-14 22:51

救命啊

大师门 为什么我这段代码  数据库里的密码 不能改  谢谢帮帮忙  本人刚学不久
<% dim lj,rs,j,x,q,sql,y
   set lj=server.CreateObject("adodb.connection")
   lj.open "driver=Microsoft Access Driver (*.mdb);dbq="&server.MapPath(" KFGL.mdb")
   if request.form("submit")="提交" then
    j=request.form("jm")
x=request.form("xm")
q=request.form("qm")
y=request.form("yhu")
if j="" or x="" or y="" or q=""then
set lj=server.CreateObject("adodb.connection")
   lj.open "driver=Microsoft Access Driver (*.mdb);dbq="&server.MapPath(" KFGL.mdb")
response.write("*不能为空")
if x<>q then
response.write"两次密码不同"
else
sql="select*from ma where mima='"&x&"' where czy='"&yhu&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,lj,1,3
if not rs.eof then
rs.close
    set rs=nothing
sql="update ma set mima='"&x&"' where czy='"&y&"'"
rs.open sql,lj,1,3
end if
end if
end if
end if
  %>

网者 发表于 2006-12-16 08:24

<!--#include file="conn.asp"-->
<%
ic=request.form("ic")
psw=request.form("psw")
newpassword = Request("password")
set rs=server.createobject("adodb.recordset")
rs.open "select * from sa where ic='"&ic&"' and psw='"&psw&"'" ,conn,1,1
if rs.eof or rs.bof then
response.write "<script>alert('密码或用户名错误');window.close();</script>"
else
if not (rs.bof and rs.eof) then
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
rs.open "update sa set psw='"&newpassword&"' where ic='"&ic&"'",conn,1,1
response.write "<script>alert('密码修改成功');window.close();</script>"
rs.close
set rs=nothing
end if
end if
%>
这是我做的能改,你看看,我也是刚学,共同努力:handshake

kos 发表于 2006-12-16 16:46

谢谢 朋友加油哦 :handshake
当我不知道我错在哪里  很郁闷

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com