I am a newbie using asp, however what i am trying to do is quite basic and i believe all is correct. am i forgetting to do something with the server?
any ideas? pls help
Many thanks in advance
Natalia
Error:
"Error 405 Method Not Allowed
The requested method POST is not allowed for URL /Asp_pages/loginaction.asp"
My Web Form:
<form action="loginaction.asp" method="post">
Username<input name="p_username" size="22">
Password<input type="password" name="p_password" size="22">
<input type="submit" value="Log In">
My Response Page:
<%@ LANGUAGE="VBSCRIPT" %>
<% p_username = Request.form("p_username")
p_password = Request.form("p_password")
set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Nataliaz_web"
sqlText="select * from Members where username='"&p_username&"'"
set userSet = cn.Execute(sqlText)
if userSet.EOF then
'No such username, so the recordSet is empty
Response.Redirect "loginati.asp?retry=username"
else
'The username is good, now let's check the password
real_password = trim(userSet("password"))
if p_password = real_password then
'Password is good, too
Response.Redirect "album.htm"
%>
<%
else
'Username is good, but password is wrong
Response.Redirect "loginati.asp?retry=password
end if
end if
%>
<%
userSet.Close
set userSet = Nothing
cn.Close
set cn = Nothing
%>