regsave.jsp
上传用户:helenhuo66
上传日期:2007-06-01
资源大小:865k
文件大小:6k
源码类别:

百货/超市行业

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ include file="top.jsp"%>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <meta http-equiv="refresh" content="3;url=reg.jsp">
  5. <link href="css.css" rel="stylesheet" type="text/css">
  6. <%
  7. String errmsg="错误!";
  8. boolean founderr=false;
  9. String user_name,user_pass,user_pass2,user_adds,user_tel,user_mail,user_postcode;
  10. user_name=errmsg;
  11. user_pass=errmsg;
  12. user_pass2=errmsg;
  13. user_adds=errmsg;
  14. user_tel=errmsg;
  15. user_mail=errmsg;
  16. user_postcode=errmsg;
  17. if(request.getParameter("user_name").equals("")){
  18. errmsg=errmsg+"用户名不能为空,";
  19. founderr=true;
  20. }else user_name=getStr(request.getParameter("user_name"));
  21. if(request.getParameter("user_pass").equals("")){
  22. errmsg=errmsg+"密码不能为空,";
  23. founderr=true;
  24. }else user_pass=getStr(request.getParameter("user_pass"));
  25. if(request.getParameter("user_pass2").equals("")){
  26. errmsg=errmsg+"密码确认不能为空,";
  27. founderr=true;
  28. }else user_pass2=getStr(request.getParameter("user_pass2"));
  29. if(!user_pass.equals(user_pass2)){
  30. errmsg=errmsg+"两次密码不同!";
  31. founderr=true;
  32. }
  33. if(request.getParameter("user_adds").equals("")){
  34. errmsg=errmsg+"地址不能为空,";
  35. founderr=true;
  36. }else user_adds=getStr(request.getParameter("user_adds"));
  37. if(request.getParameter("user_tel").equals("")){
  38. errmsg=errmsg+"电话号码不能为空,";
  39. founderr=true;
  40. }else user_tel=getStr(request.getParameter("user_tel"));
  41. if(!IsMail(request.getParameter("user_mail"))){
  42. errmsg=errmsg+"你的E-mail有错误,";
  43. founderr=true;
  44. }else user_mail=getStr(request.getParameter("user_mail"));
  45. if(request.getParameter("user_postcode").equals("")){
  46. errmsg=errmsg+"邮编不能为空,";
  47. founderr=true;
  48. }else user_postcode=getStr(request.getParameter("user_postcode"));
  49. sql="select * from member where user_name='"+user_name+"'";
  50. rs=mdb.executeQuery(sql);
  51. if(rs.next()){
  52.     errmsg=errmsg+"用户名已被别人注册";
  53.     founderr=true;
  54. }
  55. %>
  56. <div align="center">
  57.   <center>
  58. <table border="0" width="500" cellspacing="0" cellpadding="0" height="5" style="border-collapse: collapse" bordercolor="#111111">
  59.           <%if(founderr==false){
  60.   String sql1;
  61.               sql1="Insert into member(user_name,user_pass,user_adds,user_mail,user_tel,user_regip,user_namec,user_type) values('"+user_name+"','"+user_pass+"','"+user_adds+"','"+user_mail+"','"+user_tel+"','"+request.getRemoteHost()+"','"+getStr(request.getParameter("user_namec"))+"','会员')";
  62.               mdb.executeInsert(sql1);
  63.             %>
  64.           <tr> 
  65.             <td height="25" align="center" bgcolor="#DBC2B0">注册成功</td>
  66.             
  67.           </tr>
  68.           <tr> 
  69.             <td bgcolor="#F5EFE7"> <table border="0" width="100%" cellspacing="1">
  70.                 <tr> 
  71.                   <td width="100%" ><br> 
  72.                   <div align="center">
  73.                     <center> 
  74.                     <table width="90%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
  75.                       <tr> 
  76.                         <td width="33%" height="25"><div align="right">用户名:</div></td>
  77.                         <td width="67%" height="25"><div align="center"><%=user_name%></div></td>
  78.                       </tr>
  79.                       <tr> 
  80.                         <td width="33%" height="25"><div align="right">密码:</div></td>
  81.                         <td width="67%" height="25"><div align="center"><%=user_pass%></div></td>
  82.                       </tr>
  83.                       <tr> 
  84.                         <td width="33%" height="25"><div align="right">E-mail:</div></td>
  85.                         <td width="67%" height="25"><div align="center"><%=user_mail%></div></td>
  86.                       </tr>
  87.                       <tr> 
  88.                         <td width="33%" height="25"><div align="right">地址:</div></td>
  89.                         <td width="67%" height="25"><div align="center"><%=user_adds%></div></td>
  90.                       </tr>
  91.                       <tr> 
  92.                         <td width="33%" height="25"><div align="right">电话:</div></td>
  93.                         <td width="67%" height="25"><div align="center"><%=user_tel%></div></td>
  94.                       </tr>
  95.                       <tr> 
  96.                         <td width="33%" height="25"><div align="right">邮编:</div></td>
  97.                         <td width="67%" height="25"><div align="center"><%=user_postcode%></div></td>
  98.                       </tr>
  99.                       <tr> 
  100.                         <td height="25" colspan="2"> <div align="center"><a href="index.jsp">请返回首页登陆,3秒后自动返回</a></div></td>
  101.                       </tr>
  102.                       <tr> 
  103.                         <td colspan="2"></td>
  104.                       </tr>
  105.                       <tr> 
  106.                         <td colspan="2"></td>
  107.                       </tr>
  108.                     </table>
  109.                     </center>
  110.                   </div>
  111.                     <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
  112.                       <tr> 
  113.                         <td valign="middle"><div align="center"><img src="img/pics/seperator.gif" width="359" height="1"></div></td>
  114.                       </tr>
  115.                     </table></td>
  116.                 </tr>
  117.               </table></td>
  118.           </tr>
  119.           <%}
  120.   else
  121.   {%>
  122.           <tr> 
  123.             <td width="100%" height="25" align="center" bgcolor="#DBC2B0">注册失败</td> 
  124.           </tr>
  125.           <tr> 
  126.             <td bgcolor="#F5EFE7"> <table border="0" width="100%" cellspacing="1">
  127.                 <tr> 
  128.                   <td width="100%"><%=errmsg%></td>
  129.                 </tr>
  130.               </table></td>
  131.           </tr>
  132.         </table>
  133.   </center>
  134. </div>
  135. <%}%>
  136. <%@ include file="copy.jsp"%>