AdminLogin.jsp
上传用户:lsj999sz
上传日期:2022-06-15
资源大小:4717k
文件大小:1k
源码类别:

ICQ/即时通讯

开发平台:

Java

  1. <%@ page language="java" contentType="text/html; charset=GB18030"
  2.     pageEncoding="GB18030"%>
  3. <%
  4. String action = request.getParameter("action");
  5. if(action != null && action.equals("login")) {
  6. String username = request.getParameter("username");
  7. String password = request.getParameter("password");
  8. if( !username.equals("admin") || !password.equals("admin") ) {
  9. out.println("username or password not correct!");
  10. return;
  11. }
  12. session.setAttribute("admin" , "admin");
  13. response.sendRedirect("admin/AdminIndex.jsp");
  14. }
  15. %>
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  17. <html>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=GB18030">
  20. <title>Insert title here</title>
  21. </head>
  22. <body>
  23. <form action="AdminLogin.jsp" method="post">
  24. <input type="hidden" name="action" value="login"/>
  25. <table border="1" align="center">
  26. <tr>
  27. <td>admin name:</td>
  28. <td><input type="text" size="10" name="username"/></td>
  29. </tr>
  30. <tr>
  31. <td>admin password:</td>
  32. <td><input type="password" size="10" name="password"/></td>
  33. </tr>
  34. <tr>
  35. <td></td>
  36. <td><input type="submit" value="login"/><input type="reset" value="reset"/></td>
  37. </tr>
  38. </table>
  39. </form>
  40. </body>
  41. </html>