reg_ok.jsp
上传用户:cnkaiguan
上传日期:2014-08-25
资源大小:5403k
文件大小:2k
- <div align="center"><a href="login.jsp"><<返回登录页面</a></div>
- <%@page contentType="text/html;charset=gbk"%>
- <%@page import="java.sql.*" %>
- <%
- String sidcustomer=request.getParameter("idcustomer");
- String idcustomer=new String(sidcustomer.getBytes("iso-8859-1"));
-
- String susername=request.getParameter("username");
- String username=new String(susername.getBytes("iso-8859-1"));
-
- String spassword=request.getParameter("password");
- String password=new String(spassword.getBytes("iso-8859-1"));
-
- String sdoublepassword=request.getParameter("doublepassword");
- String doublepassword=new String(sdoublepassword.getBytes("iso-8859-1"));
-
- String sphone=request.getParameter("phone");
- String phone=new String(sphone.getBytes("iso-8859-1"));
-
- String semail=request.getParameter("email");
- String email=new String(semail.getBytes("iso-8859-1"));
-
- String sstate=request.getParameter("selectstate");
- String state=new String(sstate.getBytes("iso-8859-1"));
-
- String scity=request.getParameter("city");
- String city=new String(scity.getBytes("iso-8859-1"));
-
- String szip=request.getParameter("zip");
- String zip=new String(szip.getBytes("iso-8859-1"));
-
- String saddress=request.getParameter("address");
- String address=new String(saddress.getBytes("iso-8859-1"));
-
-
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- Connection con=DriverManager.getConnection("jdbc:odbc:booksystem");
- Statement sql=con.createStatement();
- ResultSet rs=sql.executeQuery("select * from customers where idcustomer='"+idcustomer+"' ");
- if(rs.next())
- response.sendRedirect("errorpage.jsp");
- else
- {
- sql.executeUpdate("insert into customers values('"+idcustomer+"','"+username+"','"+password+"','"+doublepassword+"','"+phone+"','"+email+"','"+state+"','"+city+"','"+zip+"','"+address+"')");
-
- out.print(" '"+username+"'用户注册成功,请记好您的ID号!!!"+"<br>");
- out.print("您的会员ID号为:[ "+idcustomer+" ]");
- }
- con.close();
- %>