验证面

Connection.asp
<%
'打开数据库
Dim Conn
Set Conn=Server.CreateObject("EipWebDb.EipConn")
%>

<script language="vbscript" runat="server">                                              
function Check_Pass()
  response.buffer=true
  response.Expires=0
  response.write "<font color=##000000 style='font-size:9pt;font-family: 宋体'>"
  username=request.form("username")
  password=request.form("password")
  'dim rs                 
  'set mycommand=server.createobject("adodb.command") 
  'set mycommand.ActiveConnection=conn 
  sql="Pro_GetYz @yhname='" & trim(username) & "',@yhpw='" & md5(trim(password)) &"'"'
  set rs=Conn.DoExecute(sql)
  if trim(rs("state"))=0014 then
    msg=trim(rs("info"))& "<br>"
    call LoginError(msg,"Login.asp",1)
    response.end
    Check_Pass=false
  else
    Response.Cookies("EipLogin")("qx")= trim(rs("yhqx"))
    Response.Cookies("EipLogin")("softqx")=trim(rs("softqx"))
    Response.Cookies("EipLogin")("bm")= trim(rs("ygbm"))
    Response.Cookies("EipLogin")("Skin")= trim(rs("yhskin"))
    Response.Cookies("Member")("UserId")=trim(rs("userid")) '为ASP会员提供
    Check_Pass=true
 end if
end function
</script>
<%
 if Check_Pass() then
     dim PathStr1,PathStr2,UrlStr1,UrlStr2
     PathStr1="http://" & WebPath(1) & "/"
     PathStr2="http://" & WebPath(2) & "/"
     UrlStr1=instr(lcase(request("HTTP_REFERER")),lcase(PathStr1))
     UrlStr2=instr(lcase(request("HTTP_REFERER")),lcase(PathStr2))
     if (UrlStr1<>0) then
       Response.Cookies("EipLogin").domain=WebPath(1)
     end if
     if (UrlStr2<>0) then
       Response.Cookies("EipLogin").domain=WebPath(2)
     end if
     response.Cookies("EipLogin").path="/"     
  response.Cookies("EipLogin")("yh") =trim(request("username"))
  response.Cookies("Member")("UserName") = request("username") '为ASP会员提供
  'Response.write "<script language=javascript>window.open('Index.asp');this.location='../Index.asp';</script>"
     Response.Redirect "index.asp"
  end if
%>

posted on 2004-06-11 14:14  乔本生涯a  阅读(374)  评论(0编辑  收藏  举报

导航