Author

Topic: .80 to whoever can help me figure this out. (Deposits w/ PHP) (Read 1170 times)

hero member
Activity: 576
Merit: 514
Thanks!
sr. member
Activity: 294
Merit: 250
Bitsky, your address was in your sig, so i sent the coin to that address.
sr. member
Activity: 294
Merit: 250
Hamburger and bitsky, both of those worked, so im going to split the reward because bitsky got to it first, and hamburger also showed me a great alternative to bitcoinnotify. Please PM or reply with your bitcoin addresses.
Thank you guys!
full member
Activity: 241
Merit: 107
Hi,

First create a file output.txt and chmod it 777


Then create a file test.php or whatever you want to name it and past this code in it;

Code:

    $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);
    }

?>

Send notifications to this file and the result should be recorded in output.txt

Just adjust the file names and paths to make it secure to receive your notifications - also have a look at http://www.bitcoinpayflow.com/ as alternative or back up notification or complimentary notification to enhance your security. 

Hamburger
hero member
Activity: 576
Merit: 514
You're seeing a blank page because you don't send any POST data. The reply to bitcoinnotify's request would contain the POST data in its reply.

If you need to see the data, your script needs to log it. You can simply dump it into a file:

Code:
$f=fopen('/path/to/logs/bitcoinnotify.log''a');
fwrite($f"[".date('r')."]: data received\n");
fwrite($f': POST: '.print_r($_POSTtrue));
fclose($f);
?>


Remember that, depending on your config, you might have to adjust the permissions on the log file so that your webserver can write to it.
sr. member
Activity: 262
Merit: 250
Have a look at your apache logs. You should see the requests coming in from BitcoinNotify.

sr. member
Activity: 294
Merit: 250
The problem:
Users need to deposit money on my site, im using bitcoinnotify.com and when users send money to one of my addresses, bitcoinnotify sends a HTTP POST to my url with deposit information. I created a simple page just to see what information bitcoinnotify.com was sending me, and all im getting is blank pages. The code im using is:
print_r($_POST);
?>

Ive also created a "test" page and created a POST form and sent it to the deposit page, which showed the information.

What i need:
I dont specifically need to use bitcoinnotify.com and if there is a easier way, then i would use that. Ill pay for whoever figure out how i can get deposits and my server recognizes it so it shows in the user account.

I may up the ante if i see it needs it, but .80 is all i have in my account ATM.

BTW, i may need more work done...
Jump to: