日期:2014-05-17 浏览次数:20743 次
<%
Statement stmt = conn.createStatement();
String s_username = request.getParameter("username");
String pass1 = request.getParameter("pass1");
String email = request.getParameter("email");
String strSql = "select * from user where username='"+s_username+"' or email='"+email+"'";
ResultSet rs = stmt.executeQuery(strSql);
out.println(rs.next());
if(rs.next()){
%>
<h3 style="text-align:center">您注册的用户名已被占用!</h3>
<p style="text-align:center"><a href="register.jsp">重新注册</a></p>
<%}else{%>
<h3 style="text-align:center">注册成功!</h3>
<%
String strSql1 = "insert into user(username,password,email) values('"+s_username+"','"+pass1+"','"+email+"')";
stmt.executeUpdate(strSql1);
}
%>