adminreg_result.jsp
上传用户:cnkaiguan
上传日期:2014-08-25
资源大小:5403k
文件大小:1k
- <div align="center"><a href="adminreg.jsp"><<返回管理员注册页面</a></div>
- <%@page contentType="text/html;charset=gbk"%>
- <%@page import="java.sql.*" %>
- <%
- String sidadmin=request.getParameter("idadmin");
- String idadmin=new String(sidadmin.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"));
-
-
-
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- Connection con=DriverManager.getConnection("jdbc:odbc:booksystem");
- Statement sql=con.createStatement();
- ResultSet rs=sql.executeQuery("select * from admin where idadmin='"+idadmin+"' ");
- if(rs.next())
- response.sendRedirect("errorpage.jsp");
- else
- {
- sql.executeUpdate("insert into admin values('"+idadmin+"','"+username+"','"+password+"','"+doublepassword+"')");
-
- out.print(" '"+username+"'管理员注册成功,请记好您的ID号!!!"+"<br>");
- out.print("您的管理员ID号为:[ "+idadmin+" ]");
- }
- con.close();
- %>