user7146: I'm trying to write a PHP plugin that will talk to bitcoind to generate a random address to send a bitcoin transaction to. 
I'm really confused: how am I supposed to setup bitcoind so that we can query it to generate a random address? 
Thanks!  

user6024: First, run bitcoind on your server. Set up bitcoin.conf to have the correct RPC port and a password and etc.
Then, include the jsonRPCClient.php file:
include('jsonRPCClient.php');

Then, instantiate an object like so:
$bitcoind = new jsonRPCClient("http://$YOUR_RPC_USER:$YOUR_RPC_PASS@$YOUR_RPC_HOST:$YOUR_RPC_PORT/");

You can now run commands from the RPC using this object.
$bitcoind->getnetworkhashps();
$bitcoind->getrawtransaction($txid);

So if you want a new address:
$newaddr = $bitcoind->getnewaddress();


7146: <p>I'm trying to write a PHP plugin that will talk to bitcoind to generate a random address to send a bitcoin transaction to. </p>

<p>I'm really confused: how am I supposed to setup bitcoind so that we can query it to generate a random address? </p>

<p>Thanks!  </p>
 6024: <p>First, run <code>bitcoind</code> on your server. Set up <code>bitcoin.conf</code> to have the correct RPC port and a password and etc.</p>

<p>Then, include the jsonRPCClient.php file:</p>

<pre><code>include('jsonRPCClient.php');
</code></pre>

<p>Then, instantiate an object like so:</p>

<pre><code>$bitcoind = new jsonRPCClient("http://$YOUR_RPC_USER:$YOUR_RPC_PASS@$YOUR_RPC_HOST:$YOUR_RPC_PORT/");
</code></pre>

<p>You can now run commands from the RPC using this object.</p>

<pre><code>$bitcoind-&gt;getnetworkhashps();
$bitcoind-&gt;getrawtransaction($txid);
</code></pre>

<p>So if you want a new address:</p>

<pre><code>$newaddr = $bitcoind-&gt;getnewaddress();
</code></pre>
