<!--#include file="inc/conn.asp"-->
<% 
if request("action")="login" then
   sno=request("Sname")
   Pws=request("Pws")
if Instr(sno,"or")<>0 or Instr(Pws,"or")<>0 or Instr(sno,"and")<>0 or Instr(Pws,"and")<>0 Then
   response.write("<script>alert('没事别搞人家后台，谢谢！否则一切后果自负！');window.close();</script>")
   response.end
end if
  if sno<>"" and  Pws<>"" then
   sql="select * from Tuser where sno='"&trim(sno)&"' and Pws='"&trim(Pws)&"' "
   set rs=server.createobject("adodb.recordset") 
   rs.open sql,conn,1,3
    if rs.eof then
       response.write"<script language=JavaScript>alert('对不起，帐号和密码不匹配!\n请检查，返回重新输入！');"
       response.write"location.href='index.asp'</script>"
    else
       session("sno")=rs("sno")
       session("Sname")=rs("Sname")
       response.redirect "index.asp"
	end if 
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
end if
%>