我写的一个超级简单的登陆页面,错在哪了?
我写的一个超级简单的登陆页面,没找到错误的地方,大家帮忙看看
dibao_ligon.htm
--------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style6 {font-size: 12px}
.style7 {font-size: 16px}
.style8 {font-size: 36px}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="dibao_login.jsp">
<table width="800" border="1" align="center" bordercolor="#666666">
<tr bgcolor="#3366CC">
<th width="800" height="600" bordercolor="#999999" bgcolor="#FFFF00" scope="col"><span class="style1"></span><span class="style6"> </span>
<p class="style7"> </p>
<p> </p>
<p class="style8">欢迎使用城市低保信息管理系统</p>
<p class="style8"> </p>
<p class="style8"> </p>
<table width="224" border="1" cellpadding="0" cellspacing="0">
<tr class="style6">
<td width="40">用户</td>
<td width="168"><input name="username" type="text" size="24"></td>
</tr>
<tr class="style6">
<td>密码</td>
<td><input name="password" type="text" size="24"></td>
</tr>
</table>
<p class="style6">
<input type="submit" name="Submit" value="登陆">
</p>
<p class="style6"> </p></th>
</tr>
</table>
</form>
</body>
</html>
---------------------------
dibao_login.jsp
-----------------------------------------
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="DBcon.dbconn"%>
<jsp:useBean id="DBcon"scope="page"class="DBcon.dbconn"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- TemplateBeginEditable name="doctitle" -->
<title>城市低保信息管理系统</title>
<!-- TemplateEndEditable --><style type="text/css">
<!--
.style6 {font-size: 12px}
.style7 {font-size: 16px}
.style8 {font-size: 36px}
-->
</style>
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
<body>
<%
String username=request.getParameter("username");
String password=request.getParameter("password");
Connection conn = null;
conn = DBcon.getConn() ;
ResultSet rs=DBcon.executeQuery("select * from user where user_name='"+username+"'and password='"+password+"'");
if(!rs.next())
{
response.sendRedirect("dibao_login.htm");
rs.close();
conn.close();
}
else
{
response.sendRedirect("edit_fam_tb.jsp");
rs.close();
conn.close();
}
%>
</body>
</html>
----------------------------
<%@ page import="DBcon.dbconn"%>
<jsp:useBean id="DBcon"scope="page"class="DBcon.dbconn"/>
这里面引用自己写的连接类,一直在正常使用肯定没问题.