<tfoot id='tT024'></tfoot>
  1. <legend id='tT024'><style id='tT024'><dir id='tT024'><q id='tT024'></q></dir></style></legend>
  2. <i id='tT024'><tr id='tT024'><dt id='tT024'><q id='tT024'><span id='tT024'><b id='tT024'><form id='tT024'><ins id='tT024'></ins><ul id='tT024'></ul><sub id='tT024'></sub></form><legend id='tT024'></legend><bdo id='tT024'><pre id='tT024'><center id='tT024'></center></pre></bdo></b><th id='tT024'></th></span></q></dt></tr></i><div id='tT024'><tfoot id='tT024'></tfoot><dl id='tT024'><fieldset id='tT024'></fieldset></dl></div>

        <bdo id='tT024'></bdo><ul id='tT024'></ul>

      <small id='tT024'></small><noframes id='tT024'>

    1. 仅在使用 DNS 时 AJAX 请求上的 405(不允许的方法)

      405 (Method Not Allowed) on AJAX request only when using DNS(仅在使用 DNS 时 AJAX 请求上的 405(不允许的方法))
          1. <small id='4K6K4'></small><noframes id='4K6K4'>

          2. <i id='4K6K4'><tr id='4K6K4'><dt id='4K6K4'><q id='4K6K4'><span id='4K6K4'><b id='4K6K4'><form id='4K6K4'><ins id='4K6K4'></ins><ul id='4K6K4'></ul><sub id='4K6K4'></sub></form><legend id='4K6K4'></legend><bdo id='4K6K4'><pre id='4K6K4'><center id='4K6K4'></center></pre></bdo></b><th id='4K6K4'></th></span></q></dt></tr></i><div id='4K6K4'><tfoot id='4K6K4'></tfoot><dl id='4K6K4'><fieldset id='4K6K4'></fieldset></dl></div>
            <legend id='4K6K4'><style id='4K6K4'><dir id='4K6K4'><q id='4K6K4'></q></dir></style></legend>
              <tbody id='4K6K4'></tbody>
            <tfoot id='4K6K4'></tfoot>

                <bdo id='4K6K4'></bdo><ul id='4K6K4'></ul>
                本文介绍了仅在使用 DNS 时 AJAX 请求上的 405(不允许的方法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个非常奇怪的问题,我使用 AJAX 从我的 html 页面发送电子邮件,该页面链接到我在同一网站中的 PHP 页面.当我以 IP 模式1xx.xx.xxx.xxx:8080/mywebsite 进入网站时,AJAX 请求工作正常,只有当我使用链接到该 IP 地址的 DNS 时,才会出现此错误:

                POST http://www.mywebsite.ma/sendEmail.php 405(方法不允许)

                这是 AJAX 请求:

                $.ajax({类型:POST",url: "sendEmail.php",数据:datastr,缓存:假,成功:功能(html){如果(html ==成功"){庆祝TheSuccessOfThisEmailSending();} 别的 {杀了我自己();}},错误:函数(){sumTingWong();}});

                解决方案

                我终于找到了问题所在,不知道是不是因为我对 Servers 和其他东西缺乏经验而没有看到.长话短说:我在服务器上安装了 Wamp,我使用 IP+端口来访问它,但是当我使用 DNS 时它直接指向网站文件(包括 php 文件)而它没有不经过Wamp.

                我最终卸载了 Wamp 并将 PHP 包含在我的 IIS 服务器中以直接编译 PHP 文件,而无需安装另一台服务器.

                我遵循了本教程 -> 如何在 Windows Server 2008 的 IIS 7 上安装 PHP

                I have a really weird problem, I use AJAX to send an email from my html page, which links to a PHP page I have within the SAME website. The AJAX request works fine when I enter the website in IP mode 1xx.xx.xxx.xxx:8080/mywebsite only when I use a DNS that links to this IP address I get this error :

                POST http://www.mywebsite.ma/sendEmail.php 405 (Method Not Allowed)

                Here's the AJAX request :

                $.ajax({
                    type: "POST",
                    url: "sendEmail.php",
                    data: datastr,
                    cache: false,
                    success: function(html){
                        if (html == "success"){
                            celebrateTheSuccessOfThisEmailSending();
                        } else {
                            killMySelf();
                        }
                    },
                    error: function() {
                        sumTingWong();
                    }
                });
                

                解决方案

                I finally found the problem, I don't know how I didn't see due to my lack of experience with Servers and stuff. Long story short : I installed Wamp on the server, I used the IP+Port to access it, but when I use the DNS it directly points to the website files(including php files) and it didn't go through Wamp.

                I ended up uninstalling Wamp and including PHP in my IIS server to directly compile PHP files without the need to install another server.

                I followed this tutorial -> How to Install PHP on IIS 7 for Windows Server 2008

                这篇关于仅在使用 DNS 时 AJAX 请求上的 405(不允许的方法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                get a # from a url in php(从 php 中的 url 获取 #)
                PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                  <small id='FIK3w'></small><noframes id='FIK3w'>

                    <bdo id='FIK3w'></bdo><ul id='FIK3w'></ul>
                    • <i id='FIK3w'><tr id='FIK3w'><dt id='FIK3w'><q id='FIK3w'><span id='FIK3w'><b id='FIK3w'><form id='FIK3w'><ins id='FIK3w'></ins><ul id='FIK3w'></ul><sub id='FIK3w'></sub></form><legend id='FIK3w'></legend><bdo id='FIK3w'><pre id='FIK3w'><center id='FIK3w'></center></pre></bdo></b><th id='FIK3w'></th></span></q></dt></tr></i><div id='FIK3w'><tfoot id='FIK3w'></tfoot><dl id='FIK3w'><fieldset id='FIK3w'></fieldset></dl></div>
                        <tbody id='FIK3w'></tbody>
                      <legend id='FIK3w'><style id='FIK3w'><dir id='FIK3w'><q id='FIK3w'></q></dir></style></legend>
                      1. <tfoot id='FIK3w'></tfoot>