<!--#include file=conn.asp-->
<%
name=request("name")
pwd=request("pwd")

	set rs=server.createobject("adodb.recordset")
	sql="select * from admin where pwd='"&pwd&"' and name='"&name&"'"
'	response.write ""&sql&""
'	response.end
	rs.open sql,conn,1,1
 	if not(rs.bof and rs.eof) then
 		if pwd=rs("pwd") then
			session("admin")=rs("name")
			session("flag")=rs("flag")
			Response.Redirect "manage.asp"
 		else
			call Error
 		end if
	else
		call Error()
	end if
	%>
	
	<%
sub Error()
		response.write "   <html><head><link rel='stylesheet' href='style.css'></head><body>"
	    	response.write "   <br><br><br>"
	    	response.write "    <table align='center' width='300' border='0' cellpadding='4' cellspacing='0' class='border'>"
	    	response.write "      <tr > "
	    	response.write "        <td class='title' colspan='2' height='15'> "
	    	response.write "          <div align='center'>操作: 确认身份失败!</div>"
	    	response.write "        </td>"
	    	response.write "      </tr>"
	    	response.write "      <tr> "
	    	response.write "        <td class='tdbg' colspan='2' height='23'> "
	    	response.write "          <div align='center'><br><br>"
	    	response.write "      用户名或密码错误!!! <br><br>"
	    	response.write "        <a href='javascript:onclick=history.go(-1)'>返回</a>"        
	    	response.write "        <br><br></div></td>"
	    	response.write "      </tr>   </table></body></html>" 
	end sub
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing

%>

