Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
<?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);
?>

The above mentioned code works perfectly on my localhost but not on web hosting server.

Please Help me regarding this.

Regards
Tushar Srivastava
Posted

1 solution

I don't have we got quite complete information about your particular problem. Anyway, it looks like the method itself it a standard HTTP method: "POST", but this is the method most usually causing this problem. Here is a good explanation:
http://www.checkupdown.com/status/E405.html[^].

—SA
 
Share this answer
 
Comments
Er. Tushar Srivastava 14-Oct-12 2:50am    
Thank you Sir :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900