JspShop网络购物系统即凡人网上购物系统jsp版(jsp+mysql/jsp+access)的架构是基于Jsp/JavaBean的模式
源代码在线查看: 2login.jsp
if(request.getParameter("action").equals("login")){
String admin_name=request.getParameter("admin_name");
String admin_pass=request.getParameter("admin_pass");
if((admin_name.indexOf("'")!=-1)||(admin_pass.indexOf("'")!=-1))
out.print("请不要使用非法字符");
else{
String sql="select * from admin where admin_name='"+admin_name+"' and admin_pass='"+admin_pass+"'";
ResultSet rs=mdb.executeQuery(sql);
if(!rs.next())
out.print("用户名和密码不匹配");
else{
session.setAttribute("admin_name",""+rs.getString("admin_name")+"");
response.sendRedirect("manage.jsp");
}
mdb.Close();
}
}
%>