📄 denglu01.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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">
<!--
.style1 {
color: #FF9900;
font-weight: bold;
}
.style2 {color: #FF6600}
-->
</style>
</head>
<body>
<%
int n;
String temp1=new String();
String temp2=new String();
temp1=request.getParameter("textfield1");
temp2=request.getParameter("textfield2");
n=temp1.length()*temp2.length();
%>
<%if(n==0){
%>
<span class="style2"><strong>您的输入有误,请重新输入</strong>.</span><a href="denglu.jsp">返回</a>
<%
}
else{
String tempuser=new String();
String tempid=new String();
String url=new String();
url="jdbc:odbc:userg1";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
String SQL=new String();
SQL="SELECT * FROM user WHERE user='"+temp1+"'and mima='"+temp2+"'";
ResultSet rs=stmt.executeQuery(SQL);
if(rs.next()){
tempuser=rs.getString("user");
tempid=rs.getString("id");
session.putValue("user",tempuser);
rs.close();
%>
<span class="style1">用户</span> <%=tempuser%><%=tempid%><span class="style1">你好!!!!!!</span><a href="index.jsp">返回首页</a>
<%
}
else{
%>
<span class="style2"><strong>该用户不存在,请重新登陆!</strong></span><a href="denglu.jsp">返回</a>
<%
}
stmt.close();
con.close();
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -