服务器错误-405-不允许使用用于访问此页面的HTTP动词

时间:2018-10-03 13:04:43

标签: html iis-7.5

我刚刚继承了一个站点,并将副本移至Windows Server 2008测试服务器。当我测试登录过程时,出现服务器错误:

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

我看过登录代码,它使用弹出窗口显示登录表单,然后在关闭时似乎正在运行jQuery脚本。这都是在login.html页面上发生的-这是当前的样子:

$(document).ready(function() {

      $("#myform").validate({
        //this is the submit = Log in
        submitHandler: function(form) {
          $.post('../login.php', $("#myform").serialize(), function(data) {
            var theString = (data);
            var subString = theString.substr(0, 5);
            if (subString == "Error")
            //if the string starts with error then, guess what, it's an error!
            {
              $('#results').html(theString);
            } else //open the string as a link, it should be the database entry address returned
            {
              window.location = theString;
            }
          });
        } //close function(data)
      });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>


<!-- START ADD THIS FOR LOG IN WINDOW -->
<!-- START Log in window -->

<div id="backgroundPopup"></div>
<div id="popupContact">

  <h1> Log In.</h1>


  <table width="300" align="center">
    <form id="myform" method="POST">

      <tr>
        <td height="20">
          <div align="right"> User Name <input class="" name="username" type="text" size="30" /></div>
        </td>
      </tr>


      <tr>
        <td height="20">
          <div align="right">Password <input name="password" type="password" size="30" /></div>
        </td>
      </tr>
      <tr>
        <td height="5">
      </tr>

      <tr>
        <td align="right" height="20">



          <input type="submit" name="action" value="LogIn" class="login_button" />

          <!--  class="login_button" style="font-size:11px"
 			// class="my_password"  style="font-size:11px" -->
          <!--<a id="popupContactClose">x</a> -->
    </form>

    </td>
    </tr>

    <br />
  </table>

  <div class="error" id="results"> </div>
</div>
<div id="backgroundPopup"></div>

<!-- END Log in window -->
<!-- END ADD THIS FOR LOG IN WINDOW -->

从研究类似问题开始,提交到不接受POST请求的.html页面似乎是一个问题,但是我找不到允许此设置(如果这确实是实际问题)。到目前为止,在没有成功显示此错误消息(也正在运行Windows Server 2008)的当前服务器上,我找不到任何设置。

我现在不希望对代码进行任何更改(例如,转换为PHP等),只需允许对login.html页面进行POST请求,即可使其在我们的测试服务器上运行。

0 个答案:

没有答案