Bitcoin Forum
June 22, 2018, 09:17:03 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Stupid question about doing a transaction with php rpc  (Read 795 times)
divergenta
Full Member
***
Offline Offline

Activity: 162
Merit: 100


View Profile
May 13, 2011, 11:13:24 AM
 #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?
1529702223
Hero Member
*
Offline Offline

Posts: 1529702223

View Profile Personal Message (Offline)

Ignore
1529702223
Reply with quote  #2

1529702223
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

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

Posts: 1529702223

View Profile Personal Message (Offline)

Ignore
1529702223
Reply with quote  #2

1529702223
Report to moderator
1529702223
Hero Member
*
Offline Offline

Posts: 1529702223

View Profile Personal Message (Offline)

Ignore
1529702223
Reply with quote  #2

1529702223
Report to moderator
1529702223
Hero Member
*
Offline Offline

Posts: 1529702223

View Profile Personal Message (Offline)

Ignore
1529702223
Reply with quote  #2

1529702223
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 1013


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
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:  

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!