📄 login.jsp
字号:
<html>
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>销售管理信息系统</title>
</head>
<jsp:useBean id="db" scope="page" class="sale.dbBean" />
<body>
<p align="center"><font size="7" color="#000080">销售管理信息系统</font></p>
<hr>
<%
int n;
String id=new String();
String pwd=new String();
id=request.getParameter("id");
pwd=request.getParameter("pwd");
n=id.length()*pwd.length();
String sql=new String();
ResultSet rs=null;
%>
<%--判断用户的输入是否缺项--%>
<%
if(n==0){
%>
<p align="center">请输入完整的用户名和口令</p>
<p align="center"><a href="index.htm"><font color="#000080">返回</font></a></p>
<%
}
else
{
sql="select * from user1 where id='"+id+"' and pwd='"+pwd+"'";
rs=db.executeQuery(sql);
if(rs.next())
{
rs.close();
db.close();
session.setAttribute("id",id);
response.sendRedirect("user.jsp");
}
else
{
%>
<p align="center">请输入正确的用户名和口令</p>
<p align="center"><a href="index.htm"><font color="#000080">返回</font></a></p>
<%
}
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -