标题:asp+sql问题
只看楼主
boy8088
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-3-24
得分:0 
兄弟们帮帮我
<%@language="vbscript" codepage="936"%>
<!--#include file="connnews/connnews.asp"-->
<%
admin_name=trim(request.form("admin_name"))
admin_password=trim(request.Form("admin_password"))
admin_yz=trim(request.Form("admin_yz"))
if admin_name="" and admin_password="" and admin_yz="" then
response.Write("<script language=javascript>alert('请填写完整!');")
response.Write("window.history.back();")
response.Write("</script>")
elseif Isnumeric(admin_yz)=true and int(session("getcode"))=int(admin_yz) then
set conn=server.CreateObject("adodb.connection")
conn.open news_data_string
set rs = server.CreateObject("adodb.recordset")
rs.activeconnection = news_data_string
rs.source="select admin_name from news_admin where admin_name='"&admin_name &"'"
rs.cursortype=0
rs.cursorlocation=2
rs.locktype=1
rs.open()
if not rs.bof and not rs.eof then
if rs("admin_password")=admin_password then
session("admin_name")=rs("admin_name")
response.Redirect("admin_index.asp")
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("密码不正确!"))
end if
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("非法用户!"))
end if
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("验证码错误!"))
rs.close
set rs=nothing
end if
%>
错误提示:(0x800A000D)
2006-03-29 16:34
boy8088
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-3-24
得分:0 
<%
admin_name=trim(request.form("admin_name"))
admin_password=trim(request.Form("admin_password"))
admin_yz=trim(request.Form("admin_yz"))
if admin_name="" and admin_password="" and admin_yz="" then
response.Write("<script language=javascript>alert('请填写完整!');")
response.Write("window.history.back();")
response.Write("</script>")
elseif Isnumeric(admin_yz)=true and int(session("getcode"))=int(admin_yz) then
set conn=server.CreateObject("adodb.connection")
conn.open news_data_string
set rs = server.CreateObject("adodb.recordset")
rs.activeconnection = news_data_string
rs.source="select admin_name from news_admin where admin_name='"&admin_name &"'"
rs.cursortype=0
rs.cursorlocation=2
rs.locktype=1
rs.open()
if not rs.bof and not rs.eof then
if rs("admin_password")=admin_password then
session("admin_name")=rs("admin_name")
response.Redirect("admin_index.asp")
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("密码不正确!"))
end if
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("非法用户!"))
end if
else
response.Redirect("admin_login.asp?msg="&server.URLEncode("验证码错误!"))
rs.close
set rs=nothing
end if
%>
2006-03-29 16:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-52507-1-1.html




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

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