日期:2014-05-17 浏览次数:20688 次
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>登录信息</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <script type="text/javascript"> function my_submit(form){ if(form.uid.value = ""||form.uid.value = null){ alert("用户名不能为空"); form.uid.focus(); return false; } if(form.pwd.value = ""||form.pwd.value = null){ alert("用户名不能为空"); form.pwd.focus(); return false; } form.action = "login2.jsp"; form.submit(); return true; } function onRegister(form){ form.action = "register.jsp" form.submit(); return true; } </script> </head> <body> <form method="post" name="f1"> <center> <h2>用户登录</h2> <table> <tr> <td> 姓名: </td> <td> <input type="text" name="uid"> </td> </tr> <tr> <td> 密码: </td> <td> <input type="text" name="pwd"> </td> </tr> <tr> <td> <input type="submit" name="Submit" value=" 确定 " onclick="return my_submit(f1)" > </td> <td> <input type="button" name="register" value=" 注册 " onclick="return onRegister(f1)" > </td> </tr> </table> </center> </form> </body> </html>