userRegPost.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:5k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

Java

  1. <%@ page language="java" contentType="text/html;charset=UTF-8"
  2.  errorPage="err.jsp" %>
  3. <%@ include file="./GVinc/gvImport.jsp" %>
  4. <%
  5. response.setHeader("Pragma","No-cache");//HTTP 1.1
  6. response.setHeader("Cache-Control","no-cache");//HTTP 1.0
  7. response.setHeader("Expires","0");//防止被proxy
  8. String userName, userPass, userSex, userName2, userEmail, userQuestion, userAnswer;
  9. String userBirthday, userWeb, userQQ, userArea, userCity, userWork, userPen, userIntro, userTxt;
  10. String userYear, userMonth, userDate;
  11. int userAreaId = TypeChange.stringToInt(request.getParameter("gvUserAreaId"));
  12. boolean actPost;
  13. String act="add";
  14. if(request.getParameter("act")==null){
  15. act = "add";
  16. }else{
  17. act = request.getParameter("act").trim();
  18. }
  19. //if(act.equals("add")){
  20. userName = request.getParameter("gvUserName").trim();
  21. //}else{
  22. //userName = gvUserName;
  23. //}
  24. //out.print(userName);
  25. userPass = request.getParameter("gvUserPass").trim();
  26. userEmail = request.getParameter("gvUserEmail").trim();
  27. userYear = request.getParameter("gvUserYear");
  28. userMonth = request.getParameter("gvUserMonth");
  29. userDate = request.getParameter("gvUserDate");
  30. if(userName==null||userPass==null||userEmail==null){
  31. out.print(OutPrint.prtCenter("注册时 用户名、密码、电子邮件均不能为空!","",2));
  32. out.close();
  33. if(true)return;
  34. }else{
  35. if(request.getMethod().equals("POST")){
  36. cui = null;
  37. cui = cu.userInfo(userName);
  38. //判断社区是否存在同名用户ID
  39. if(cui!=null && !act.equals("edit")){
  40. out.print(OutPrint.prtCenter("社区内已有同名用户存在,请换名注册!","",2));
  41. out.close();
  42. if(true)return;
  43. }else{
  44. cu.setUserName(userName);
  45. cu.setUserPass(userPass);
  46. cu.setUserSex(TypeChange.stringToByte(request.getParameter("gvUserSex")));
  47. cu.setUserName2(request.getParameter("gvUserName2").trim());
  48. cu.setUserEmail(request.getParameter("gvUserEmail").trim());
  49. //if(act.equals("add")){
  50. cu.setUserQuestion(request.getParameter("gvUserQuestion"));
  51. cu.setUserAnswer(request.getParameter("gvUserAnswer"));
  52. //}
  53. cu.setUserBirthday(userYear + "-" + userMonth + "-" + userDate);
  54. cu.setUserEmailOpen(TypeChange.stringToShort(request.getParameter("gvUserEmailOpen")));
  55. cu.setUserWeb(request.getParameter("gvUserWeb").trim());
  56. cu.setUserQQ(request.getParameter("gvUserQQ").trim());
  57. cu.setUserArea(request.getParameter("gvUserArea").trim());
  58. cu.setUserCity(request.getParameter("gvUserCity").trim());
  59. cu.setUserPen(request.getParameter("gvUserPen").trim());
  60. cu.setUserWork(request.getParameter("gvUserWork").trim());
  61. cu.setUserIntro(request.getParameter("gvUserIntro").trim());
  62. cu.setUserRegip(request.getRemoteAddr());
  63. cu.setUserLastip(request.getRemoteAddr());
  64. cu.setUserAreaId(userAreaId);
  65. cu.setUserPic("");
  66. cu.setUserID(gvUserID);
  67. cu.setAct(act);
  68. actPost = cu.userRegPost();
  69. //out.print(cu.getMessage());
  70. if(!actPost){
  71. out.print(OutPrint.prtCenter(cu.getMessage(),"",2));
  72. out.close();
  73. if(true)return;
  74. }
  75. }
  76. }
  77. }
  78. %>
  79. <html xmlns="http://www.w3.org/1999/xhtml">
  80. <head>
  81. <title><%=clubName%>  用户注册提交</title>
  82. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  83. <link href="./GVimgs/favicon.ico" rel="Bookmark"> 
  84. <link rel="icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  85. <link rel="shortcut icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  86. <link href="./GVinc/main.css" rel="stylesheet" type="text/css" />
  87. </head>
  88. <body>
  89. <DIV id="waitDiv" style="LEFT: 40%; VISIBILITY: hidden; POSITION: absolute; TOP: 20%; TEXT-ALIGN: center">
  90. <TABLE cellPadding=6 border=0>
  91. <TBODY><TR><TD align=middle>
  92. <IMG  src="GVimgs/loading.gif" alt="请稍候..." width="30" height="30">
  93. <BR>
  94. <FONT color="red">数据载入中,请稍候...</FONT></TD></TR></TBODY></TABLE></DIV>
  95. <script type="text/javascript" src="GVscript/GVtopCode.js"></script>
  96. <script type="text/javascript" src="GVscriptInc/topBar.js"></script>
  97. <SCRIPT language="javascript">
  98. prtie('<%=clubName%>>>提交注册信息');
  99. gv_showWait('waitDiv', 1); </SCRIPT>
  100. <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
  101.   <tr class="tab1">
  102.     <td>
  103. <strong>您的位置</strong>&gt;&gt;<a href="default.jsp" target="_parent">社区首页</a>&gt;&gt;<a href="main.jsp">进站画面</a>&gt;&gt;<a href="userAgree.jsp">提交注册信息</a>
  104. </td>
  105.   </tr>
  106. </table>
  107. <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" class="tab">
  108. <tr>
  109. <td align="center" class="bg2 key"><%=clubName%> 感谢您的注册!您现在可以操作以下内容……</td>
  110. </tr>
  111. <tr>
  112. <td align="center" class="bg2">
  113. <%
  114. cui = null;
  115. cui = cu.userInfo(userName);
  116. %>
  117. <a href="userInfo.jsp?userID=<%=cui.getUserID()%>" target="_self">查看个人资料</a></td>
  118. </tr>
  119. <tr><td align="center" class="bg2">
  120. <a href="userLogin.jsp" target="_self">立即登陆社区</a>
  121. </td></tr>
  122. <tr>
  123. <td align="center" class="bg2"><a href="main.jsp" target="_self">返回社区首页 </a></td>
  124. </tr>
  125. <tr>
  126. <td align="center" class="bg2"><a href="userBox.jsp" target="_self">进入个人工具箱</a></td>
  127. </tr>
  128. </table>
  129. <%=Gfoot()%>
  130. </body>
  131. </html>