Bitcoin Forum
June 27, 2025, 08:55:50 AM *
News: Pizza day contest voting
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED].001 btc bounty for whoever helps with this php issue (using R  (Read 648 times)
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 12, 2014, 03:55:11 AM
Last edit: January 12, 2014, 05:08:11 AM by lmfsthefounder
 #1

Having an issue making a transaction through php with the JSON api.

Heres the code:

Code:
else if (@$coin_type == 'btc') { 
echo $coin_type;
if ($btcbalance < $w_amount+$tx_fee) {
echo "<h1> You can't withdraw more than you have available. It maybe the .001 transaction fee, please check your math.</h1>";
}
else {
$btc->sendfrom($username,$send_to,$w_amount);
}
}

Note:          $btc->sendfrom($username,$send_to,$w_amount); is the line giving me the error. The error comes as follows:

Quote
coinye Warning: fopen(http://...@66.227.203.224:41337/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\inetpub\wwwroot\includethis.php on line 132 Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://xxxx:xxxx@66.227.203.224:41337/' in C:\inetpub\wwwroot\includethis.php:140 Stack trace: #0 C:\inetpub\wwwroot\withdrawal.php(52): jsonRPCClient->__call('sendfrom', Array) #1 C:\inetpub\wwwroot\withdrawal.php(52): jsonRPCClient->sendfrom('lmfsthefounder', '5baud3bQkE3Dpkv...', '1') #2 {main} thrown in C:\inetpub\wwwroot\includethis.php on line 140

The documentation states the syntax as :

sendfrom:   <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]

so I used a plaintext account name, the to address and the amount, which I get from forms with _get
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 12, 2014, 05:07:39 AM
 #2

nevermind, SOLVED.

Anyone having this issue:

make sure that when you _get the amount data from the HTML form, you do something like this:

Code:
$w_amount= (int)@$_GET["amount"];

before, I didnt have (int) there, and it was failing because it thought it was a string, rather than a number
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!