如何解决错误:405 [英] How to resolve Error: 405
问题描述
你好朋友,
我刚刚注册了一个免费的虚拟主机计划,以在线测试我的一些代码,并根据需要对其进行必要的更改.
现在,这就是问题所在.我设计了一个在线购物网站.我正在使用贝宝沙盒进行测试.我正在使用cURL将数据发布到包含隐藏表单(要发布到Paypal,使用通过cURL接收到的数据生成的表单)的页面上,并具有简单的加载屏幕.现在它可以在我的本地主机(相同的配置)上正常工作,但是当我在Web托管服务器上对其进行测试时,以下错误发生了:
错误:405-不允许用于访问此页面的HTTP动词.
您正在寻找的页面无法显示,因为使用了无效的方法(HTTP动词)来尝试访问.
我的cURL代码的片段在这里:
Hello Friends,
I have just signed up for a free web hosting plan to test some of my codes online and make necessary changes to them as required.
Now, here''s the problem. I have designed an online shopping website. I am using paypal sandbox to test it. i am using cURL to post the data to a page that contains a hidden form (to be posted to Paypal, generated using data received through cURL) and simple loading screen. Now it works fluid on my localhost (same configs), but when I test it on my web hosting server, the following error crept in:
ERROR: 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.
A snippet of my cURL code is here :
<?php
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"secure_post.php");
curl_setopt($ch,CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURL_POSTFIELDS, $data);
curl_exec($ch);
curl_close($ch);
?>
上面提到的代码可以在我的本地主机上完美运行,但不能在虚拟主机服务器上运行.
请帮助我.
问候
Tushar Srivastava
The above mentioned code works perfectly on my localhost but not on web hosting server.
Please Help me regarding this.
Regards
Tushar Srivastava
推荐答案
ch = curl_init(); curl_setopt(
ch = curl_init(); curl_setopt(
ch,CURLOPT_URL," ); curl_setopt(
ch,CURLOPT_URL,"secure_post.php"); curl_setopt(
ch,CURLOPT_RETURNTRANSFER,false); curl_setopt(
ch,CURLOPT_RETURNTRANSFER, false); curl_setopt(
这篇关于如何解决错误:405的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!