·我写的用户登陆函数,登陆后 只要改变传递的参数值就可以进入别的用户的管理界面有谁能帮我修复这个BUG急

来源:百度知道 编辑:UC知道 时间:2024/09/23 07:34:31
Function checksysUser()
sql="SELECT * FROM xyxx WHERE username='"&username&"'"
Set rs=Server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
if rs.eof then
checksysUser=FALSE
else
passwd=trim(rs("password"))
if passwd=password then
Session("adminuser")=username
Session("mima")=gmn
Session("id")=rs("id")
session.timeout=500
checksysUser=TRUE
else
checksysUser=FALSE
end if
End if
rs.close
conn.close
End Function

b=checksysUser()
if b=true then
Response.Redirect ("user.asp?gmn="&gmn)
end if
登陆后
只要改动 如: user.asp?gmn=9 改成 user.asp?gmn=12
就会转到别的用户的管理界面 有什么办法可修复这个BUG
急!急!急!急!

用session呀
登录时设置session("id")=当前的ID
然后访问user.asp?gmn=9时
再判断request("gmn")与session("id")是不是相同
相同就可以访问,不相同就不给访问... response.end

不知