<%@ page contentType="text/html;charset=GB2312" import="java.sql.*"%>
<% 
String NAME=request.getParameter("name");
String psw=request.getParameter("password");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:wgc");
java.sql.Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select PASSWORD from password where name='"+NAME+"'");%>
<html><head>
<title>验证</title>
</head><body>
<%
if(rs.next())
{
if(rs.getString("PASSWORD").equals(psw))
{
session.setAttribute("NAME",NAME);
response.sendRedirect("admin_index.jsp");
}
else
{%>
<script>
window.alert("输入用户名或密码有误!!");
location="login.htm";
</script>
<%}}
else{
%>
<script>
window.alert("输入用户名或密码有误!!");
location="login.htm";
</script>
<%}
rs.close();
stmt.close();
conn.close();%>
</body>