Bitcoin Forum

Bitcoin => Project Development => Topic started by: wildboy211 on September 13, 2011, 07:33:48 AM



Title: Using bitcoinnotify.com - cannot get POST data.
Post by: wildboy211 on September 13, 2011, 07:33:48 AM
Im using a test event to send a HTTP Post request to my server, but when i trigger the event, nothing shows up, im using simple PHP coding:
print_r($_POST);

And all im getting is:
Array ( )

And im refreshing multiple times after trigger. Am i doing it wrong or anyone have any idea what the problem could be?


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: BitcoinNotify.com on September 13, 2011, 08:10:34 AM
I have manually POST-ed your URL with an independent tool - cREST client plugin for Chrome (https://chrome.google.com/webstore/detail/baedhhmoaooldchehjhlpppaieoglhml) - and the result is the same "Array ( )", which means there is something wrong with your server configuration or PHP script.

Random ideas:

1) As far as I know the $_POST is deprecated in PHP. Perhaps try a more recent function?

2) Remember that with POST, parameters are sent in the HTTP request body, not in the URL (just in case this matters).


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: wildboy211 on September 14, 2011, 04:16:21 AM
I have manually POST-ed your URL with an independent tool - cREST client plugin for Chrome (https://chrome.google.com/webstore/detail/baedhhmoaooldchehjhlpppaieoglhml) - and the result is the same "Array ( )", which means there is something wrong with your server configuration or PHP script.

Random ideas:

1) As far as I know the $_POST is deprecated in PHP. Perhaps try a more recent function?

2) Remember that with POST, parameters are sent in the HTTP request body, not in the URL (just in case this matters).

I am trying this with another host, and when i sent the information from a test page with a simple hidden object and a submit button, the post data transfered over. But when i try it with the chrome plugin or bitcoinnotify i get nothing. The PHPccode im using now is:
<?
print $_REQUEST["type"];
?>

And this isnt my first PHP page either...im totally baffled on why this isnt working.


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: hamburger on September 14, 2011, 08:47:46 AM
I hate it when people refer to other posts so I'll help you here.

First create a file output.txt and chmod it 777
Now, create a file test.php and past this code in it;

Code:
<?php

    $output 
file_get_contents('php://input');

    
$fp=fopen($tmp_path."output.txt","a");
    if(
$fp) {
      if(
flock($fp,LOCK_EX)) {
        
fwrite($fp,$output."\n");
        
flock($fp,LOCK_UN);
      }
      
fclose($fp);
    }

?>


Go to http://www.bitcoinpayflow.com/test_pn and enter http://www.yourdomain.com/test.php then click on Test.

If all went well, you should see on the screen what was send to test.php

Wait some time - the server is a bit slow.

Check your output.txt file for the result.

Hamburger


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: wildboy211 on September 14, 2011, 01:15:36 PM
I hate it when people refer to other posts so I'll help you here.

First create a file output.txt and chmod it 777
Now, create a file test.php and past this code in it;

Code:
<?php

    $output 
file_get_contents('php://input');

    
$fp=fopen($tmp_path."output.txt","a");
    if(
$fp) {
      if(
flock($fp,LOCK_EX)) {
        
fwrite($fp,$output."\n");
        
flock($fp,LOCK_UN);
      }
      
fclose($fp);
    }

?>


Go to http://www.bitcoinpayflow.com/test_pn and enter http://www.yourdomain.com/test.php then click on Test.

If all went well, you should see on the screen what was send to test.php

Wait some time - the server is a bit slow.

Check your output.txt file for the result.

Hamburger


Worked like a charm, PM or reply with your bitcoin address as you also won half of the reward on my other post.


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: hamburger on September 14, 2011, 02:07:15 PM

 ::) never! always a pleasure to help.

If you really want to give away Bitcoin, please send it to;

1AvN36TvnWxkUYYBRckpRxyFcys5Z28bSB

this is an open wallet -

He that hath found the wallet, hath found a good thing, and shall receive a bitcoin bounty in abundance!

Nah, the mighty google will not reveal the location of this wallet!

Hamburger


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: wildboy211 on September 14, 2011, 02:32:48 PM

 ::) never! always a pleasure to help.

If you really want to give away Bitcoin, please send it to;

1AvN36TvnWxkUYYBRckpRxyFcys5Z28bSB

this is an open wallet -

He that hath found the wallet, hath found a good thing, and shall receive a bitcoin bounty in abundance!

Nah, the mighty google will not reveal the location of this wallet!

Hamburger

The bounty is 0.40 more!
http://blockexplorer.com/address/1AvN36TvnWxkUYYBRckpRxyFcys5Z28bSB (http://blockexplorer.com/address/1AvN36TvnWxkUYYBRckpRxyFcys5Z28bSB)

And you are right, the mighty google does not show the location of the wallet.


Title: Re: Using bitcoinnotify.com - cannot get POST data.
Post by: hamburger on September 14, 2011, 04:46:31 PM

Thank you, someone might get lucky soon!