<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="conn" scope="page" class="download.conn"/>
<%!
	ResultSet rs = null;
	String sql = "";
	String username = "";
	String password = "";
%>
<%
username = request.getParameter("username");
password = request.getParameter("password");
if(username==null || username.equals("")) {
%>
   <jsp:forward page="login.jsp"/>
<%
}
if(password==null || password.equals("")) {
%>
   <jsp:forward page="login.jsp"/>
<%
}	
sql = "select * from admin where username='" + username + "' and password='" + password + "'";
rs = conn.executeQuery ( sql );
if(rs.next()) {
   	session.setAttribute("login","ok");
%>
   <jsp:forward page="xtwh.jsp"/>
<%
}else {
%>
   <jsp:forward page="login.jsp"/>
<%
}
rs.close();
%>
