Bitcoin Forum
June 28, 2024, 05:06:53 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Passing parameters to bitcoin daemon using php library  (Read 1193 times)
spndr7 (OP)
Legendary
*
Offline Offline

Activity: 1020
Merit: 1000



View Profile WWW
June 24, 2013, 01:09:42 PM
 #1

Quote
<?php

 require_once 'jsonRPCClient.php';
 
  $bitcoin = new   jsonRPCClient('http://username:password@127.0.0.1:9999/');
 
   $json =$bitcoin->getnewaddress();        // here  parameter required
   var_dump($json);
  echo "</pre>";         

?>


How to pass parameter to function 'getnewaddress' ?

spndr7 (OP)
Legendary
*
Offline Offline

Activity: 1020
Merit: 1000



View Profile WWW
June 24, 2013, 01:40:14 PM
 #2

library used here is

http://jsonrpcphp.org/

spndr7 (OP)
Legendary
*
Offline Offline

Activity: 1020
Merit: 1000



View Profile WWW
June 25, 2013, 05:07:43 AM
Last edit: June 25, 2013, 06:19:24 AM by spndr7
 #3

no one uses php with bitcoin, or is my question wrong ?

domob
Legendary
*
Offline Offline

Activity: 1135
Merit: 1166


View Profile WWW
June 25, 2013, 10:37:36 AM
 #4

no one uses php with bitcoin, or is my question wrong ?

I use it (well, namecoin to be precise) but have written my own RPC call library based on the command-line tool.  I don't know about the one you use.  (I can point you to my code if you want to switch, but I guess that would be even more complicated.)

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
June 25, 2013, 12:11:33 PM
 #5

Quote
<?php

 require_once 'jsonRPCClient.php';
 
  $bitcoin = new   jsonRPCClient('http://username:password@127.0.0.1:9999/');
 
   $json =$bitcoin->getnewaddress();        // here  parameter required
   var_dump($json);
  echo "</pre>";         

?>


How to pass parameter to function 'getnewaddress' ?

Just pass the parameters in the getnewaddress() call.

Code:
$json = $bitcoin->getnewaddress("Account_Name");

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
spndr7 (OP)
Legendary
*
Offline Offline

Activity: 1020
Merit: 1000



View Profile WWW
June 26, 2013, 03:35:12 AM
 #6

Quote
Just pass the parameters in the getnewaddress() call.

Code:
$json = $bitcoin->getnewaddress("Account_Name");

Thanks for help.

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!