chkmemlogin.asp

来自「简单整站程序」· ASP 代码 · 共 40 行

ASP
40
字号
<!--#include file=conn.asp-->
<!--#include virtual="/include/md5.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<%
   MemberName=Request.Form("MemberName")
   MemberPass=Request.Form("MemberPass")
   MemberName=Replace(MemberName,"'","")
   MemberPass=Replace(MemberPass,"'","")
   MemberPass=md5(MemberPass)
   
   if MemberName="" then 
      response.Write "<script>alert('用户名不能为空!');history.go(-1);</script>"
      response.end
   end if
   if Request.Form("MemberPass")="" then 
      response.Write "<script>alert('密码不能为空!');history.go(-1);</script>"
      response.end
   end if
   
   set rs=conn.execute("select * from ShopMember where MemberName='"&MemberName&"' and MemberPass='"&MemberPass&"' ")
   if not rs.eof then
      if rs("State")=0 then 
         response.write "<script>alert('您的帐号已被冻结,如有疑问请联系网站管理员!');history.go(-1);</script>"
         response.end
      else 
         Response.Cookies("MemberName")=MemberName
         Response.Cookies("MemberPass")=MemberPass
         Response.Cookies("MemberID")=rs("MemberID")
         if Request.QueryString("ReturnUrl")<>1 then 
            Response.Redirect "/Shop/ShopManage/index.asp"      
         else 
            Response.Redirect Request.ServerVariables("HTTP_REFERER")    
         end if
         response.end
      end if
   else
      response.write "<script>alert('用户名或密码错误!');history.go(-1);</script>"
      response.end   
   end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?