Bitcoin Forum
May 10, 2024, 03:03:04 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Stupid question about doing a transaction with php rpc  (Read 896 times)
divergenta (OP)
Full Member
***
Offline Offline

Activity: 162
Merit: 100


View Profile
May 13, 2011, 11:13:24 AM
Last edit: May 13, 2011, 12:39:32 PM by divergenta
 #1

                              


Assume that $account is a account with a balance in my bitcoind, $address is a valid address and that $amount is the amount of bitcoin that should be sent, I'm wondering if the following is the correct way to do a transaction using php:



  require_once 'jsonRPCClient.php';
  $bitcoin = new jsonRPCClient('http://usr:psw@127.0.0.1:8332/');
  $transaction = $bitcoin->sendfrom($account, $address, $amount);
  echo $transaction; // doing a echo to see the respone

Or am I doing anything wrong?
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
1715310184
Hero Member
*
Offline Offline

Posts: 1715310184

View Profile Personal Message (Offline)

Ignore
1715310184
Reply with quote  #2

1715310184
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
May 13, 2011, 12:53:52 PM
 #2

Looks ok to me, assuming $account and $address are strings and $amount is a number.


How often do you get the chance to work on a potentially world-changing project?
divergenta (OP)
Full Member
***
Offline Offline

Activity: 162
Merit: 100


View Profile
May 13, 2011, 01:43:24 PM
 #3

Ah, It works!

My $account was a integer and I just needed to convert it to a string and now it works like a charm. Thanks Gavin.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!