后端登陆
<%@ page import="wangzhan.Thesql" %> <%@ page import="com.mysql.cj.Session" %> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> </head> <% Thesql sql=new Thesql(); request.setCharacterEncoding("utf-8"); String id_=request.getParameter("id_"); String password=request.getParameter("password"); if(id_!=null) if(id_.length()==8){ if(sql.stu_IsPass(id_, password)){ HttpSession httpSession= request.getSession(); httpSession.setAttribute("id_",id_); %> <jsp:forward page="STU.jsp"> <jsp:param value="<%=id_ %>" name="id"/> <jsp:param value="student" name="identity"/> </jsp:forward> <% } } else if(id_.length()==6){ if(sql.tea_IsPass(id_, password)){ HttpSession httpSession= request.getSession(); httpSession.setAttribute("id_",id_); %> <jsp:forward page="TEA.jsp"> <jsp:param value="<%=id_%>" name="id_"/> <jsp:param value="teacher" name="identity"/> </jsp:forward> <% } } else if(id_.length()==3){ if(sql.root_IsPass(id_, password)){ HttpSession httpSession= request.getSession(); httpSession.setAttribute("id_",id_); %> <jsp:forward page="all_Root.jsp"> <jsp:param value="<%=id_ %>" name="id"/> <jsp:param value="root" name="identity"/> </jsp:forward> <% } } %><script type="text/javascript"> alert('请输入正确密码或是账号。'); </script> <meta http-equiv="refresh" content="1;url=Login.jsp" > <% %> <body> </body> </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
· 零经验选手,Compose 一天开发一款小游戏!