Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login page on web site not woking...

Status
Not open for further replies.

bgreen

Programmer
Feb 20, 2003
185
CA
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>
 
Change
<form method="POST" action="../login/Login.jsp">

to
<form method="GET" action="../login/Login.jsp">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top