Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What bitcoin php library are you using? Looks like maybe <a href="https://github.com/mikegogulski/bitcoin-php" rel="nofollow">this one?</a></p> <p>If that's the case, it doesn't return an error message, it <a href="http://code.gogulski.com/bitcoin-php/class_bitcoin_client.html#ac0a7d86e63a8e1efe8036b0a1bcc62b7" rel="nofollow">throws BitCoinClientException</a></p> <p>So you need something like</p> <pre><code> try { $message = ($bitcoin-&gt;sendfrom($mywallet,$to_wallet,$wammount)); } catch (Exception $e) { echo $e-&gt;getMessage(); } </code></pre> <p><strong>Updating</strong> The ob_start seems superfluous because you don't output anything before the header location. Unless you have output something before you've reached this point in which case you can't send a header. So you'd need to move the ob_start up towards the top of the script before any output. </p> <p>Also you aren't sending message to the wallet.php script. Or are you done with it at that point?</p> <hr> <p><strong>RE: update 2</strong> One thing I might add is the possibility of some other exception message occuring we haven't thought of yet that doesn't contain the "Unable." I'd do something more like:</p> <pre class="lang-php prettyprint-override"><code>$errorOccured = false; try { $message = ($bitcoin-&gt;sendfrom($mywallet,$to_wallet,$wammount)); } catch (Exception $e) { $errrorMessage = $e-&gt;getMessage(); $errorOccured = true; } if (!$errorOccured) { ... } else { header("Location: mywallet.php?error=true&amp;errormsg=" . $errorMessage); ... } </code></pre> <p>This would require modifying mywallet.php to accept <code>$errorMessage</code> as an additional GET parameter so you can send it back to the user. Might be nice to additionally use another parameter for sending <code>$message</code> on success which would contain the transaction ID.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload