⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reg_ok.jsp

📁 jsp与数据库连接的图书馆管理系统
💻 JSP
字号:
<style type="text/css">
<!--
body {
	background-color: #FFCCFF;
}
-->
</style><div align="center"><a href="login.jsp">返回登录页面</a></div>
<%@page contentType="text/html;charset=gbk"%><style type="text/css">
<!--
body {
	background-image: url(images/dream018.jpg);
}
.STYLE1 {
	font-size: large;
	font-weight: bold;
}
.STYLE2 {font-size: medium}
-->
</style>
<%@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:driver={Microsoft Access Driver (*.mdb)};DBQ=webapps/booksystem/db/bs.mdb;");
	Statement sql=con.createStatement();
	ResultSet rs=sql.executeQuery("select idcustomer,username,password,doublepassword,phone,email,state,city,zip,address from customers where idcustomer='"+idcustomer+"' ");
	if(rs.next())
		response.sendRedirect("errorpage.jsp");
	else
		{
		sql.executeUpdate("insert into customers(idcustomer,username,password,doublepassword,phone,email,state,city,zip,address) values('"+idcustomer+"','"+username+"','"+password+"','"+doublepassword+"','"+phone+"','"+email+"','"+state+"','"+city+"','"+zip+"','"+address+"')");
		
		out.print(" '"+username+"'用户注册成功,请记好您的ID号!!!"+"<br>");
		out.print("您的会员ID号为:[ "+idcustomer+" ]");
		}
	con.close();
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -