Bitcoin Forum
December 08, 2016, 04:08:07 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: PHP - Display all transactions to address  (Read 792 times)
joeyjoe
Full Member
***
Offline Offline

Activity: 224


View Profile
August 23, 2011, 04:16:14 PM
 #1

Im just trying to display all the transactions in a table that were sent to the account called "1"

just like bitcoinduit does it:

http://bitcoinduit.com/Klondike_Gold_Rush

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
1481170087
Hero Member
*
Offline Offline

Posts: 1481170087

View Profile Personal Message (Offline)

Ignore
1481170087
Reply with quote  #2

1481170087
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481170087
Hero Member
*
Offline Offline

Posts: 1481170087

View Profile Personal Message (Offline)

Ignore
1481170087
Reply with quote  #2

1481170087
Report to moderator
1481170087
Hero Member
*
Offline Offline

Posts: 1481170087

View Profile Personal Message (Offline)

Ignore
1481170087
Reply with quote  #2

1481170087
Report to moderator
vv01f
Sr. Member
****
Offline Offline

Activity: 314


View Profile
August 23, 2011, 06:24:13 PM
 #2

We now know what you wanna achieve, but we cannot exactly know which ways you have been going already to implement btc with your php-host.
Probably you can post some more information how you connect to daemon and if you get any other information from it already or you still lack the connection..

but if you simply are interested, the wiki gives - at least for my contiguous - enough info: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#PHP

the method to call is listreceivedbyaccount or listreceivedbyaddress (as you know the exact address when you know the acc) as you can read here: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list#Full_list

donations to me please send via bitcoin 1vvo1FDwSAwNdLVA1mFkM7v76XPZAAUfb
a good European exchange: bitcoin.de (ref-link)
joeyjoe
Full Member
***
Offline Offline

Activity: 224


View Profile
August 24, 2011, 12:32:20 PM
 #3

Thanks. I managed to work out how to do it. The problem i had is that it would output it in raw data, but i needed to output into an array. a simple bit of php code i was overlooking.

I have managed to do this now, but confused as to why i cannot list the senders address with the transactions

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
Anonymous
Guest

August 28, 2011, 01:13:14 AM
 #4

Im just trying to display all the transactions in a table that were sent to the account called "1"

just like bitcoinduit does it:

http://bitcoinduit.com/Klondike_Gold_Rush
Sorry, but this was too tempting. I wrote an entire script when I saw this problem and I have to show it off!
Code:
<?php
//Create $jsonRPCClient
$transactions $jsonRPCClient->listtransactions('1',100000000); // the 100000000000 is the max transactions listed. The default is ten, so we set this to a really high number to make sure we list as many transactions as we can
$info $jsonRPCClient->getInfo();
$fee $info["paytxfee"];
$table "<table id=\"transactions\"><tr><th>Txn ID</th><th>To Address</th><th>Value</th></tr>";
foreach (
$txn in $transactions) {
$id $txn["txid"];
$link "http://blockexplorer.com/tx/$id";
$id substr($id,5) . '...';
$address $txn["address"];
$value $txn["amount"]+($txn["amount"] < $fee 0);
$table .= "<tr><td><a href=\"$link\">$id</a></td><td>$address</td><td>$value</td></tr";
}
$table .= "</table>";
echo 
$table
?>

I can write an entire script that does styling and so on, with more detail, and other formatting for .5BTC if you want (if you don't have a script already)
helloworld
Full Member
***
Offline Offline

Activity: 182


View Profile
August 28, 2011, 01:43:50 AM
 #5

There is a typo in the above code:

$jsonRPCClient->listtsansactions(

Anonymous
Guest

August 28, 2011, 03:13:24 AM
 #6

There is a typo in the above code:

$jsonRPCClient->listtsansactions(


Thanks, fixed
joeyjoe
Full Member
***
Offline Offline

Activity: 224


View Profile
August 28, 2011, 03:24:29 AM
 #7

Thanks for your input, i managed to do everything i needed. www.interbitlotto.com - I do do PHP just not with bitcoin, but pretty much figured it out now Smiley

thanks anyway

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!