ASP高手帮我看看这里哪写错了

Internet_Information 2010-06-13 02:42:14
<%
sub CloseConn()
conn.close
set conn=nothing
end sub

ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER")))
if ComeUrl="" then
Response.Redirect "admin_login.asp"
response.end
else
cUrl=trim("http://" & Request.ServerVariables("SERVER_NAME"))
if mid(ComeUrl,len(cUrl)+1,1)=":" then
cUrl=cUrl & ":" & Request.ServerVariables("SERVER_PORT")
end if
cUrl=lcase(cUrl & request.ServerVariables("SCRIPT_NAME"))
if lcase(left(ComeUrl,instrrev(ComeUrl,"/")))<>lcase(left(cUrl,instrrev(cUrl,"/"))) then
Response.Redirect "admin_login.asp"
response.end
end if
end if

AdminName=replace(session("AdminName"),"'","")
if AdminName=Empty then
call CloseConn()
response.redirect "Admin_login.asp"


end if
...全文
115 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
qzlndd 2010-06-14
  • 打赏
  • 举报
回复
楼主你好坏也得说一下出错的位置,出什么错了。
XSTT_ 2010-06-14
  • 打赏
  • 举报
回复
可提交的名是不是错了.做个rseponse.write 来跟踪下走到那里.password这个SQL关键字也是问题之一,但如果是这个问题的话.应该报错并中止运行了.
gingerkang 2010-06-13
  • 打赏
  • 举报
回复
问题很有一些
你自己有环境,自己调试撒,发一堆字母,别人很难看的,又没有调试信息

response.redirect是直接跳转了,不用再response.end,他前面response.write 的内容也无法看到的
对某个用户登录,你不能去更新所有用户的信息为这个用户的登录信息吧,更新条件需要加入
sy_binbin 2010-06-13
  • 打赏
  • 举报
回复
唉!!这明显是找茬游戏啊
猜我是几娃 2010-06-13
  • 打赏
  • 举报
回复
应该就是4楼说的了
sql里面password是保留字,用[]包起来
  • 打赏
  • 举报
回复
后台密码输入正确也不能跳转到 index.asp 进不去后台
sy_binbin 2010-06-13
  • 打赏
  • 举报
回复
sql="select * from [jle_admin] where UserName='"&UserName&"' and [password]='"&password&"'"
lingyun410 2010-06-13
  • 打赏
  • 举报
回复
楼主你好坏也得说一下出错的位置,出什么错了。
  • 打赏
  • 举报
回复
发错了 不好意思

是下面这个

<!--#include file="conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file=../inc/ipt.asp-->

<%
'获取IP地址
Function getIP()
Dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
actforip=Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
actforip=Request.ServerVariables("REMOTE_ADDR")
Else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
actforip=Request.ServerVariables("REMOTE_ADDR")
End If
getIP = CheckStr(Trim(Mid(strIPAddr, 1, 30)))
End Function

dim username,password,rs,sql,k
if request.cookies("admincnmai")("errs")="" then
k=0
else
k=request.cookies("admincnmai")("errs")
end if
if request.cookies("admincnmai")("errs")>5 then
response.write"<br>您输入的密码错误次数太多,系统保护中。"
response.end
end if
username=replace(trim(request("username")),"'","‘")
password=md5(replace(trim(request("password")),"'","‘"))
if UserName="" then
response.write"用户名不能为空!"
end if
if Password="" then
response.write"<br>密码不能为空!"
end if
chkcnmai(username)
if nothaveChinese(username)=false then
response.write"<br>用户名不能是中文。"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [jle_admin] where UserName='"&UserName&"' and password='"&password&"'"
rs.open sql,conn,1,3
if rs.eof then
Response.cookies("admincnmai")("errs")=k+1
response.write"<br>您输入的密码错误。"
Response.Redirect "admin_login.asp"
response.end
else
conn.execute("update jle_admin set ip = '" & getIP() & "',login_date = now()")
sql = "insert into jle_admin_login (jal_name,jal_ip) values ('" & rs("username") & "','" & getIP() & "')"
conn.execute(sql)
'response.Write(sql)
'response.End()
Response.cookies("admincnmai")("username")=rs("username")
Response.cookies("admincnmai")("max")=rs("max")
Response.cookies("admincnmai")("domain")=Request.ServerVariables("SERVER_NAME")
end if
rs.close
set rs=nothing
closedb
Response.Redirect "index.asp"
%>
ttt2 2010-06-13
  • 打赏
  • 举报
回复
出什么错啊

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧