chkadmin.jsp

来自「JSP+ORACLE网站开发实例(下).rar」· JSP 代码 · 共 25 行

JSP
25
字号
<%@ include file="conn.jsp"%>
<%
	String sql;
String username=request.getParameter("Username");
String password1=request.getParameter("Password");

sql="select * from scott.admin where username='"+username+"'"; 
ResultSet rs_lar=stmt.executeQuery(sql); 
    if(rs_lar.next()){
	   if(rs_lar.getString("password").equals(password1)){
		   session.putValue("admin",rs_lar.getString("username"));
		  out.print("<script>");
			out.print("parent.menu.location='left.jsp';");
			out.print("window.location='main.jsp';");
			out.print("</script>");

	   }else{
			out.print("<script>alert('对不起,密码不正确');history.go(-1);</script>");
	   }
	}else{
		out.print("<script>alert('对不起,用户名不正确');history.go(-1);</script>");	
	}


%>

⌨️ 快捷键说明

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