I tried to make a Login page on my web site:
Here is the code:
My web page is on a Apache/1.3.27 Server and it is saying The requested method POST is not allowed. Is there another way to do a login page?
Login.htm
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Forwarding and Redirecting</title>
</head>
<body>
<h1 align="center"><u><b>Forwarding and Redirecting</b></u></h1>
<form method="POST" action="../login/Login.jsp">
<center>
First Name: <input type="text" name="T1" size="20">
<br>
Last Name: <input type="text" name="T2" size="20">
<br>
<input type="submit" value="Submit">
</center>
</form>
</body>
</html>
Login.jsp
<html>
<head>
<title>Login JSP</title>
</head>
<body>
<% String x=request.getParameter("T1");
String y=request.getParameter("T2");
if (x.equals("John") && y.equals("Doe"))
{
%>
<jsp:forward page="../login/startpage.jsp"/>
<% }
else
response.sendRedirect("../login/login.htm");
%>
</body>
</html>
startpage.htm
<html>
<head>
<title>Start Page</title>
</head>
<body>
Start.
<%=request.getParameter("T1");%>
<%=request.getParameter("T2");%>
</body>
</html>
Here is the code:
My web page is on a Apache/1.3.27 Server and it is saying The requested method POST is not allowed. Is there another way to do a login page?
Login.htm
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Forwarding and Redirecting</title>
</head>
<body>
<h1 align="center"><u><b>Forwarding and Redirecting</b></u></h1>
<form method="POST" action="../login/Login.jsp">
<center>
First Name: <input type="text" name="T1" size="20">
<br>
Last Name: <input type="text" name="T2" size="20">
<br>
<input type="submit" value="Submit">
</center>
</form>
</body>
</html>
Login.jsp
<html>
<head>
<title>Login JSP</title>
</head>
<body>
<% String x=request.getParameter("T1");
String y=request.getParameter("T2");
if (x.equals("John") && y.equals("Doe"))
{
%>
<jsp:forward page="../login/startpage.jsp"/>
<% }
else
response.sendRedirect("../login/login.htm");
%>
</body>
</html>
startpage.htm
<html>
<head>
<title>Start Page</title>
</head>
<body>
Start.
<%=request.getParameter("T1");%>
<%=request.getParameter("T2");%>
</body>
</html>