WebRoot/Login_U.jsp

(完整代码) 1KB

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.wgh.DB.connDB"%>
<%@ page import="com.wgh.DB.chStr"%>
<%
connDB conn=new connDB();
chStr chStr=new chStr();
String username=chStr.chStr(request.getParameter("username"));//此处必须进行编码转换,否则输入中文用户名时将出现乱码
try{
	ResultSet rs=conn.executeQuery("select * from tb_Member where username='"+username+"' and freeze=0");
	if(rs.next()){
		String PWD=request.getParameter("PWD");
		if(PWD.equals(rs.getString("password"))){
			session.setAttribute("username",username);
			response.sendRedirect("index.jsp");//跳转到index.jsp页面
		}else{
			out.println("<script language='javascript'>alert('您输入的用户名或密码错误,请与管理员联系!');window.location.href='index.jsp';</script>");
		}
	}else{
			out.println("<script language='javascript'>alert('您输入的用户名或密码错误,或您的账户已经被冻结,请与管理员联系!');window.location.href='index.jsp';</script>");
	}
}catch(Exception e){
	out.println("<script language='javascript'>alert('您的操作有误!');window.location.href='index.jsp';</script>");
}
conn.close();
%>

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。