Bitcoin Forum
September 27, 2018, 11:08:29 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED].001 btc bounty for whoever helps with this php issue (using R  (Read 542 times)
lmfsthefounder
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 12, 2014, 03:55:11 AM
 #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
1538089709
Hero Member
*
Offline Offline

Posts: 1538089709

View Profile Personal Message (Offline)

Ignore
1538089709
Reply with quote  #2

1538089709
Report to moderator
1538089709
Hero Member
*
Offline Offline

Posts: 1538089709

View Profile Personal Message (Offline)

Ignore
1538089709
Reply with quote  #2

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

Posts: 1538089709

View Profile Personal Message (Offline)

Ignore
1538089709
Reply with quote  #2

1538089709
Report to moderator
1538089709
Hero Member
*
Offline Offline

Posts: 1538089709

View Profile Personal Message (Offline)

Ignore
1538089709
Reply with quote  #2

1538089709
Report to moderator
lmfsthefounder
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:  

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!