|
|
|
@ -30,10 +30,7 @@ public class check_login_reg extends HttpServlet {
|
|
|
|
|
throws ServletException, IOException {
|
|
|
|
|
String log_name = req.getParameter("log_name");
|
|
|
|
|
String tel=req.getParameter("reg_name");
|
|
|
|
|
String id=req.getParameter("reg_p_id");
|
|
|
|
|
String name=req.getParameter("reg_p_name");
|
|
|
|
|
String sex=req.getParameter("reg_p_sex");
|
|
|
|
|
String work=req.getParameter("reg_p_work");
|
|
|
|
|
String log_pwd = req.getParameter("log_pwd");
|
|
|
|
|
String reg_name = req.getParameter("reg_name");
|
|
|
|
|
String reg_pwd1 = req.getParameter("reg_pwd1");
|
|
|
|
@ -46,7 +43,7 @@ public class check_login_reg extends HttpServlet {
|
|
|
|
|
}
|
|
|
|
|
else if(log_name==null&&log_pwd==null&®_name!=null&®_pwd1!=null&®_pwd2!=null&®_pwd1.equals(reg_pwd2)) {
|
|
|
|
|
//调用注册方法处理注册
|
|
|
|
|
go_reg(id,name,tel,sex,work,reg_pwd1, req, resp);
|
|
|
|
|
go_reg(name,tel,reg_pwd1, req, resp);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -70,7 +67,7 @@ public class check_login_reg extends HttpServlet {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
if(res.next()) {
|
|
|
|
|
String p_pwd = res.getString(6);
|
|
|
|
|
String p_pwd = res.getString(3);
|
|
|
|
|
|
|
|
|
|
if(pwd.equals(p_pwd)) {
|
|
|
|
|
session.setAttribute("user_id", name);
|
|
|
|
@ -122,7 +119,7 @@ public class check_login_reg extends HttpServlet {
|
|
|
|
|
System.out.println("出错信息如下:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
protected void go_reg(String id,String name, String tel,String sex,String work,String pwd1,HttpServletRequest req, HttpServletResponse resp) {
|
|
|
|
|
protected void go_reg(String name, String tel,String pwd1,HttpServletRequest req, HttpServletResponse resp) {
|
|
|
|
|
//System.out.println("注册方法被调用了");
|
|
|
|
|
resp.setContentType("text/html;charset=utf-8");
|
|
|
|
|
|
|
|
|
@ -136,7 +133,7 @@ public class check_login_reg extends HttpServlet {
|
|
|
|
|
out.println("该手机号已有注册账号");
|
|
|
|
|
resp.setHeader("refresh", "2;url=index/login_reg.jsp");
|
|
|
|
|
}else {
|
|
|
|
|
sql = "insert into p_inf (p_id,p_name,p_tel,p_sex,p_work,p_pwd) values('"+id+"','"+name+"','"+tel+"','"+sex+"','"+work+"','"+pwd1+"')";
|
|
|
|
|
sql = "insert into p_inf (p_name,p_tel,p_pwd) values('"+name+"','"+tel+"','"+pwd1+"')";
|
|
|
|
|
int in_res = conn.executeInsert(sql);
|
|
|
|
|
//System.out.println(in_res);
|
|
|
|
|
if(in_res==1) {
|
|
|
|
|