Guest User

Untitled

a guest
Mar 6th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. LOGIN authe
  2.  
  3.  
  4. <%--
  5. Document : loginauthe
  6. Created on : Mar 6, 2019, 11:43:15 AM
  7. Author : student
  8. --%>
  9.  
  10. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  11. <!DOCTYPE html>
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  15. <title>JSP Page</title>
  16. </head>
  17. <body>
  18. <%String u = request.getParameter("uname");
  19. String p=request.getParameter("pwd");
  20. if(u.equals("bmsit") && p.equals("BMSit"))
  21. {
  22. %>
  23. Login Success....! Welcome Mr. /Ms. <%=u%>
  24. <jsp:include page="index.jsp" flush="true"></jsp:include>
  25. <%} else {%>
  26. <span style="color:red">Invalid Attempt.., try again</span>
  27. <jsp:forward page="login.jsp" ></jsp:forward>
  28. <%} %>
  29. </body>
  30. </html>
  31.  
  32.  
  33.  
  34. login
  35.  
  36. <%--
  37. Document : login
  38. Created on : Mar 6, 2019, 11:41:00 AM
  39. Author : student
  40. --%>
  41.  
  42. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  43.  
  44. <!DOCTYPE html>
  45. <html>
  46. <head>
  47. <title></title>
  48. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  49. </head>
  50. <body>
  51. <a href="Login.html"> Login</a> |
  52. <a href="LogoutServlet"> Logout</a> |
  53. <a href="ProfileServlet"> Profile </a> <hr>
  54. <form name="loginform" action="loginauthe.jsp" method="post">
  55.  
  56. <h1 align="center"> User Login </h1>
  57. Username:<input type="text" name="uname" value="" size="25" />
  58. Password:<input type="password" name="pwd" value="" size="25" />
  59. <input type="submit" value="Login" name="login" />
  60.  
  61. </form>
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment