String reqRandom = req.getParameter("yzm");
req.setCharacterEncoding("GBK");
resp.setContentType("text/html;charset=GBK");
PrintWriter out = resp.getWriter();
if (randomCode.equals(reqRandom)) {
p = 1;
} else {
p = 2;
}
out.close();
}
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=GBK");
PrintWriter out = response.getWriter();
String n = request.getParameter("name").toString();
String c = request.getParameter("password").toString();
UserPx up = new logindbbean().user(n, c);
doPost1(request, response);
if (up == null) {
out.print(2);
return;
} else if (up != null && p == 1) {
javax.servlet.http.HttpSession session =
request.getSession();
session.setAttribute("user", up);
out.print(1);
}else if(p==2){
out.print(3);
}
前台
/ 代码
unction concealx(){
var valuec = document.getElementById("axc");
if(valuec.innerHTML!=""){
document.getElementById("ax1").style.display =
"block";
document.getElementById("ax2").style.display =
"none";
}else{