• 151127


    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录</title>
    <script type="text/javascript">
    function check()
    {
    	var uid =document.getElementById("userid");
    	if(uid.value =="")
    		{
    		alert("代码不能为空");
    		return false;
    }
    	if(uform.password.value=="")
    		{
    		alert("密码不能为空");
    		return false;
    		}
    	return true;
    	}
    </script>
    </head>
    <body>
    <form id="uform" action ="yanzheng.jsp" method="post" onSubmit="return check();">
    用户:<input id="userid" type="text" name="userid" width=30/>
    密码:<input id="passeord" type="password" name="password" width=30/>
    <input type="submit" value="登录" />
    <a href ="zhuce.jsp">注册新用户</a>
    </form>
    
    
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    String strUserid =request.getParameter("userid");
    String strUsername =request.getParameter("username");
    String strPW =request.getParameter("password");
    if(strUserid == null || strUserid.trim().length() == 0)
    {
    	response.sendRedirect("message.jsp?msgid=1");
    }
    else if(strUsername == null || strUsername.trim().length() == 0)
    {
    	response.sendRedirect("message.jsp?msgid=5");
    }else if(strPW == null || strPW.trim().length() == 0)
    {
    	response.sendRedirect("message.jsp?msgid=2");
    }
    else
    {
    	Object obj=application.getAttribute(strUserid);
        if(obj!=null){
        	response.sendRedirect("message.jsp?msgid=7");
        }
        else{
    	strUsername=new String(strUsername.getBytes("ISO-8859-1"),"UTF-8");
    	String strUser=strUserid+"#"+strUsername+"#"+strPW;
        application.setAttribute(strUserid,strUser);
        response.sendRedirect("message.jsp?msgid=6");
        }
    }
    %>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript">
    
    </script>
    </head>
    <body>
    <form action="saveUser.jsp">
    用户代码:<input type="text" name="userid" width=30/><br><br>
    用户名称:<input type="text" name="username" width=30/><br><br>
    登录密码<input type="password" name="password" width=30/><br><br>
    确认密码:<input type="password" name="queren" width=30/><br><br>
    <input type="submit" value="提交"/>
    </body>
    </html>
    

      

  • 相关阅读:
    操作系统开发系列—13.g.操作系统的系统调用 ●
    操作系统开发系列—13.f.Minix的中断处理(暂时忽略)
    操作系统开发系列—13.e.三进程
    操作系统开发系列—13.d.多进程 ●
    操作系统开发系列—解释typedef void (*int_handler) ();
    操作系统开发系列—13.c.进程之中断重入
    操作系统开发系列—13.b.进程之丰富中断处理程序
    操作系统开发系列—13.a.进程 ●
    操作系统开发系列—12.g.在内核中设置键盘中断
    操作系统开发系列—12.f.在内核中添加中断处理 ●
  • 原文地址:https://www.cnblogs.com/zhuxiaolin/p/5001808.html
Copyright © 2020-2023  润新知