Commit a227d78e authored by Arthur.Pautrel's avatar Arthur.Pautrel
Browse files

Task 5

parent 604f6991
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
......@@ -38,13 +37,13 @@
</head>
<body>
<div class="login-form">
<form action="/examples/actions/confirmation.php" method="post">
<form action="task5.jsp" method="POST">
<h2 class="text-center">Log in</h2>
<div class="form-group">
<input type="text" class="form-control" placeholder="Username" required="required">
<input name="username" type="text" class="form-control" placeholder="Username" required="required">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" required="required">
<input name="password" type="password" class="form-control" placeholder="Password" required="required">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
......
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
......@@ -7,6 +6,14 @@
<title>Task 5</title>
</head>
<body>
<h1>Successfully logged in !</h1>
<%
String username = request.getParameter("username");
String password = request.getParameter("password");
if (username.equals("Arthur") && password.equals("123456")) {
out.println("Successfully logged in");
} else {
out.println("Username or password incorrect");
}
%>
</body>
</html>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment