Bitcoin Forum
December 08, 2016, 12:32:21 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: Stupid question about doing a transaction with php rpc  (Read 713 times)
divergenta
Full Member
***
Offline Offline

Activity: 162



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?

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

Posts: 1481157141

View Profile Personal Message (Offline)

Ignore
1481157141
Reply with quote  #2

1481157141
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


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



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!