当前位置:编程学习 > JAVA >>

jsp投票系统

a <%@ include file="include.jsp"%>
<!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=gbk">
<title>Insert title here</title>
</head>
<body>
  
<jsp:useBean id="connbean" class="beans.Conndb"></jsp:useBean>
<%
String username=request.getParameter("username");
String password=request.getParameter("password");
String iscorrect="select * from yonghu where username='"+ username +"'and password='"+ password+"'";
ResultSet rs=connbean.executeQuery(iscorrect);
if(!rs.next())
{
response.sendRedirect("login.html");
rs.close();
}
else if(rs.getString("isCheck").equals("0"))
{
session.setAttribute("username", rs.getString("username"));
session.setAttribute("password", rs.getString("password"));
[color=#FF0000]session.setAttribute("isCheck", rs.getString("isCheck"));[/color] connbean.executeUpdate("update yonghu set isCheck="+"'"+1+"'"+"where username="+"'"+ username+"'");
rs.close();
response.sendRedirect("book.html");
}
else
{
response.sendRedirect("watch.jsp");
rs.close();
}
%>
    
</body>
</html>
红色部分报错

其中在yonghu表中有isCheck项,但在注册与登录界面没有。isCheck自动判断是否投票吗?
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,