日期:2014-05-17  浏览次数:20843 次

高手帮我看一句,小弟实在是无奈了....
<!--#include   file= "E_Conn.asp "-->
<!--#include   file= "Inc/MD5.asp "-->
<!--#Include   File= "Inc/Cookies.asp "-->
<!--#include   file= "Inc/Function.asp "-->

<%
UserName   =   replace(   trim(GetVariable( "M_Name ")), " ' ", " "   )
UserPwd=replace(trim(GetVariable( "M_PassWord ")), " ' ", " ")
sql= "SELECT   *   FROM   Web_Admin   WHERE   (admin_UserName= ' "&UserName& " '   and   admin_UserPwd= ' "&UserPwd& " ') "
rs=Conn.execute(sql)  
AdminName=rs( "admin_UserName ")
response.write   adminname
if   AdminName <> " "   then
session( "admin_Limit ")=rs( "admin_Limit ")
Conn.execute( "UPDATE   Web_Admin   SET   admin_loginnum   =   admin_loginnum   +   1   WHERE   (admin_UserName= ' "&UserName& " '   and   admin_UserPwd= ' "&UserPwd& " ') ")
Conn.execute( "UPDATE   Web_Admin   SET   admin_loginip   =   ' "&Request.ServerVariables( "REMOTE_HOST ")& " '   WHERE   (admin_UserName= ' "&UserName& " '   and   admin_UserPwd= ' "&UserPwd& " ') ")
end   if

Session.Timeout   =180  
IF   AdminName <> " "   then
Session( "admin_UserName ")=UserName
Session( "admin_UserPwd ")=UserPwd  
response.write   " <meta   http-equiv=refresh   content=0;URL=M_Index.asp> "
else
'Session.Abandon
response.Write   " <script   language= 'javascript '> alert( '站务管理员帐号或密码错误,请重新登录! ');history.go(-1); </script> "
response.end
end   if
%>

这个程序是别人写的,下面这一句我没看懂是什么意思,做什么用的,
session( "admin_Limit ")=rs( "admin_Limit ")

而且在另外一页,有这么一句
if     Instr(admin_Limit,   1)   > 0   then
              .
              .
      就显示后面的页面,否则就不显示.


望高手给指点指点,急啊................


------解决方案--------------------
session( "admin_Limit ")=rs( "admin_Limit ")
这句意思是
将数据库中admin_Limit字段中的数据存储到SESSION对象中,用于记录用户的登陆情况
------解决方案--------------------
Instr是一个函数
作用是 返回某字符串在另一字符串中第一次出现的位置
if Instr(admin_Limit, 1) > 0 then
这句话判断admin_Limit中有没有1
------解决方案--------------------
我也不是高手,初学的,看看下面的高手怎么解答,如果对的话把分数给我哦,哈哈~
------解决方案--------------------
session( "admin_Limit ")=rs( "admin_Limit ")
这句的意思是把数据库中管理权限记录到session中

if Instr(admin_Limit, 1) > 0 then
这句是比较的admin_limit跟1的值,如果大于0 就显示后面的页面,否则就不显示.
------解决方案--------------------
请问得分什么用??我是新手,,,我请教你..带给你分?OK???
------解决方案--------------------
if instr(admin_limit,1)> 0 then
這句這樣寫會有BUG,前面已經有人提出來了
當權限數量越過9的時候就會出現BUG。
建議你改成=>
if instr( "你的分隔符 "&admin_limit& "你的分隔符 ", "你的分隔符1你的分隔符 ")> 0 then