作业1

登录

<form action="panduan.jsp">

用 户  ID : <input name="id" type="text" width="30"/>

<br><br>

用户密码: <input name="mima" type="password" width="30"/>

<br>

<input type="submit" value="登录">

</form>

 

 

判断

<%

String id = new String(request.getParameter("id"));

String mima = new String(request.getParameter("mima"));

String S1 = "11";

String S2 = "11";

if(id.equals(S1) && mima.equals(S2))

  {out.print("登陆成功");}

else

{ response.sendRedirect("error.jsp"); }

%>

 

 

error

 

</head>

<%

response.setHeader("refresh","3;URL=denglu.jsp");

%>

</head>

<body>

账号或密码错误!

</body>

 

posted @ 2015-11-26 08:20  北辰孤星  阅读(114)  评论(0编辑  收藏  举报