formaction.jsp

来自「用java写的网上售书系统 功能详尽 支持各种类别书目查询 分页显示 购物车的暂」· JSP 代码 · 共 38 行

JSP
38
字号




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%@page import="java.sql.*"%>
<jsp:useBean id="alogin" class="login.jdbcBean" scope="page"/>

<title>无标题文档</title>
<style type="text/css">
<!--
body {
	background-image: url(images/baihe.gif);
}
-->
</style></head>

<body>
<% 
ResultSet rs;
String userName=request.getParameter("userName"); 
String passWord=request.getParameter("passWord"); 
rs=alogin.executeQuery("select * from login where username = '"+userName+"' and password = '"+passWord+"'");

if(rs.next()){session.setAttribute("userName",userName);
response.sendRedirect("successLogin.jsp");}

else response.sendRedirect("errorLogin.html"); 
alogin.closeDateBase();
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?