reguser3.jsp
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:5k
- <%@ page contentType="text/html; charset=GBK"%>
- <%@ page import="java.sql.*"%>
- <%
- try{
- //数据库连接
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL";
- String strUser = "eshop";
- String strPassword = "eshop";
- Connection con = DriverManager.getConnection(strUrl, strUser, strPassword);
- Statement st = con.createStatement();
- //判断是否有此用户
- String strUid = request.getParameter("uid");
- String strSql = "select * from RegUser where UserID='" + strUid + "'";
- ResultSet rs = st.executeQuery(strSql);
- if(rs.next()){
- rs.close();
- response.sendRedirect("loginsb.jsp");
- return;
- }
- //准备用户注册数据
- String strName = request.getParameter("name");
- strName = new String(strName.getBytes("iso8859-1"),"gb2312");
- String strSex = request.getParameter("sex").trim();
- strSex = new String(strSex.getBytes("iso8859-1"),"gb2312");
- String strPwd = request.getParameter("pwd").trim();
- strPwd = new String(strPwd.getBytes("iso8859-1"),"gb2312");
- String strQuestion = request.getParameter("question").trim();
- strQuestion = new String(strQuestion.getBytes("iso8859-1"),"gb2312");
- String strAnswer = request.getParameter("answer").trim();
- strAnswer = new String(strAnswer.getBytes("iso8859-1"),"gb2312");
- String strEmail = request.getParameter("email").trim();
- String strPhone = request.getParameter("usephone").trim();
- String strAddr = request.getParameter("haddr").trim();
- strAddr = new String(strAddr.getBytes("iso8859-1"),"gb2312");
- String strPostCode = request.getParameter("postcode").trim();
- strSql = "insert into reguser(userid,name,pwd,sex,question,answer,email,usephone,haddr,postcode,regtime) values('"
- + strUid + "','"
- + strName + "','"
- + strPwd + "','"
- + strSex + "','"
- + strQuestion + "','"
- + strAnswer + "','"
- + strEmail + "','"
- + strPhone + "','"
- + strAddr + "','"
- + strPostCode + "',sysdate)";
- // out.println(strSql);
- st.executeQuery(strSql);
- strSql = "select * from reguser where userid='" + strUid + "'";
- // out.println(strSql);
- rs = st.executeQuery(strSql);
- %>
- <head>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <BODY bgColor=#ffffff>
- <DIV align=center>
- <TABLE cellSpacing=0 cellPadding=0 width=750>
- <TBODY>
- <TR>
- <TD height=62>
- <DIV align=center><BR>
- <%
- if (rs.next()){
- %>
- <TABLE class=main cellSpacing=1 cellPadding=2 width=602 bgColor=#0099CC height="280">
- <TBODY>
- <TR>
- <TD colSpan=2 width="592" height="18">
- <p align="center"><FONT
- color=#ffffff><B>您的注册信息</B></FONT></p>
- </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="25">您的会员帐号: </TD>
- <TD bgColor=#ffffff width="455" height="25"><%=rs.getString("userid")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="25">您的姓名:</TD>
- <TD bgColor=#ffffff width="455" height="25"><%=rs.getString("name")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="25"><FONT color=#000000>性别:</FONT></TD>
- <TD bgColor=#ffffff width="455" height="25"><%=rs.getString("sex")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">密码:</TD>
- <TD bgColor=#ffffff width="455" height="26">(保密)</TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">密码提问:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("question")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">密码答案:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("answer")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">E-MAIL:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("email")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">常用电话:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("usephone")%> </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">收货地址:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("haddr")%>
- </TD></TR>
- <TR>
- <TD width=129 bgColor=#ffffff align="right" height="26">邮编:</TD>
- <TD bgColor=#ffffff width="455" height="26"><%=rs.getString("postcode")%>
- </TD></TR>
- </TBODY></TABLE>
- <BR> <input type="button" value="进入商城" name="B4" onclick="window.location.href='index.jsp';">
- </DIV></TD></TR></TBODY></TABLE>
- <%
- }
- %>
- </DIV></BODY>
- <%
- }catch(Exception e){
- e.printStackTrace();
- }
- %>