No method allowed, pls help!! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

No method allowed, pls help!!

natxnatx Posts: 3Member
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:


Username
Password


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
%>

Comments

  • iwilld0itiwilld0it Posts: 1,134Member
    : 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:
    :
    :
    : Username
    : Password
    :
    :
    : 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
    : %>
    :

    405 errors are usally related to the improper installation of front page extensions on the web server (security-wise.) It could be that your website does not have permissions set.

    Unlike ASP.NET where u set the aspnet_wp permission, you must set the IUSR_XXXX (where XXXX is the name of your webserver) instead.

    Under classic ASP IUSR_XXXX impersonates as a valid account for general viewers of your website.

    If your having problems still, then open up IIS, right click on ur website, and select "All Task" and then delete and reinstall frontpage extensions. If they were never installed then install them now. Installing them will reset the security and permissions for the website.



  • NC01NC01 Posts: 4Member
    Doesn't look like ASP.NET to me. In ASP.NET, the tag and the controls should have a runat="server" property.

    Other than that, the code looks fine for a classic asp page. Is "My Response Page" /Asp_pages/loginaction.asp?

    NC...

    : 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:
    :
    :
    : Username
    : Password
    :
    :
    : 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
    : %>
    :

Sign In or Register to comment.