⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logon.jsp

📁 jsp实现的在线投稿系统,简单的界面!数据库设计
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page session="true"%>
<%@ page import="java.sql.*"%>
<jsp:useBean id="db" scope="page" class="lianjie.DataBase"/>
<jsp:useBean id="ChineseBeanId" scope="page" class="lianjie.Tochinese"/>
<html>
<head>
<title>
登录信息
</title>
</head>
<body bgcolor="#ffffff">
<a href="tougao.jsp">进入投稿系统</a>
<%
  String user1 = ChineseBeanId.trans(request.getParameter("name"));
  String pwd1 = request.getParameter("password");
  System.out.print(pwd1); System.out.print(user1);
  String sql="select * from usertable where name='"+user1+"'and password='"+pwd1+"'";
  ResultSet rs=db.executeQuery(sql);
  int userId=0;
  try{
  if(rs.next()){
    userId=rs.getInt("userID");
    try{
      rs.close();
    }catch (Exception e){out.print("登陆有误!");}
    session.setAttribute("userId",userId+"");
    out.print("登陆成功!");}
  else{     //输入有误
  try{
    rs.close();
  }catch (Exception e3){out.print("登陆有误1!");}
}
  }catch(Exception e2){out.print("登陆有误2!");}%>

</body>
</html>

⌨️ 快捷键说明

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