用户注册界面

  1. <%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>  
  2. <%  
  3. String path = request.getContextPath();  
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
  5. %>  
  6.   
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
  8. <html>  
  9.   <head>  
  10.     <base href="<%=basePath%>">  
  11.       
  12.     <title>注册页面</title>  
  13.       
  14.     <meta http-equiv="pragma" content="no-cache">  
  15.     <meta http-equiv="cache-control" content="no-cache">  
  16.     <meta http-equiv="expires" content="0">      
  17.     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  
  18.     <meta http-equiv="description" content="This is my page">  
  19.     <!--  
  20.     <link rel="stylesheet" type="text/css" href="styles.css">  
  21.     -->  
  22. <script language="javascript">    
  23. function isValid(form)    
  24. {    
  25. if (form.username.value=="")    
  26.  {    
  27.  alert("用户名不能为空");    
  28.  return false;    
  29.  }    
  30. if (form.pwd.value!=form.pwd2.value)    
  31. {    
  32. alert("两次输入的密码不同!");    
  33. return false;    
  34. }    
  35. else  if (form.pwd.value=="")    
  36. {    
  37. alert("用户密码不能为空!");    
  38. return false;    
  39. }    
  40. else return true;    
  41. }    
  42. </script>    
  43. </head>  
  44.    
  45.   <body>  
  46.   <center>  
  47.    <body bgcolor="#e3e3e3">  
  48.   <h2>用户注册</h2>  
  49.   <form action="check2.jsp" method="post" onSubmit="return isValid(this);">  
  50. <table>  
  51.   <tr><td>用户名:</td><td><input type="text" name="username" size="20"/></td></tr>  
  52.   <tr><td>输入密码:</td><td><input type="text" name="pwd" size="20"/></td></tr>  
  53.   <tr><td>再次确认密码:</td><td><input type="text"name="pwd2" size="20"/></td><tr>  
  54.   <tr><td><input type="submit" value="注册"/><td><input type="reset" value="重置"/>  
  55.   </table>  
  56. </form>  
  57.   </center>  
  58.    <br>  
  59.   </body>  
  60. </html>  
posted @ 2017-11-27 22:10  can丶  阅读(323)  评论(0编辑  收藏  举报