<%@ page contentType="text/html; charset=UTF-8" %>
<%
session.setAttribute("Username", "");
%>

<html>
<head>
<title> Login </title>
</head>
<body bgcolor="#ffffff">
<h1>Login </h1>
<form action="Login.jsp" method="POST" >
	Username: <input type="text" name="Username" > <br>
	Password: <input type="Password" name="Passwd" > <br>
	<input type="submit" name="submit" value="Login" >
</form>
</body>
</html>

<%

if ( request.getParameter("Username") == null) {
	session.invalidate();
	return;
}

// Dinh danh
if (request.getParameter("Username").equals("admin") &&
	request.getParameter("Passwd").equals("1234") )
{
	out.println("Chuc mung dang nhap thanh cong");
	session.setAttribute("Username", request.getParameter("Username") );
	response.sendRedirect("InputForm.jsp");
}else {
	out.println("Vui long dang nhap lai");
}
%>