jsonRPCClient Error with php variables

0 votes

I am trying to run the following code:

$betamount=$_POST['bet']; 
$litecoin->move($myusername,Admin,$betamount);

but its not working. It works when i replace $betamount with an actual number ie

$litecoin->move($myusername,Admin,0.2);

or

$betamount=0.1; 
$litecoin->move($myusername,Admin,$betamount);

Can someone tell me what I am doing wrong?

Sep 12, 2018 in Blockchain by slayer
• 29,370 points
766 views

1 answer to this question.

0 votes

All you have to do is change it to this

floatval(trim()) ie ...    $betamount=floatval(trim($_POST['bet'])); 

for numbers

and this

 trim()  ie ... $litecoinaddr=trim($_POST['address']); 

for strings

answered Sep 12, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

composer network start with error SERVICE_UNAVAILABLE

I think there is an issue with ...READ MORE

answered Jul 6, 2018 in Blockchain by aryya
• 7,460 points
1,137 views
0 votes
1 answer

How to connect to *coin RPC-Server with PHP

If you want to connect inside your ...READ MORE

answered Sep 12, 2018 in Blockchain by slayer
• 29,370 points
1,610 views
0 votes
1 answer

PHP IPC with geth Ethereum: How to communicate with client?

You have to use PHP Sockets $sock = socket_create(AF_UNIX, ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 69,220 points
1,736 views
0 votes
1 answer

Ethereum Mist: Compiling Error with sha3

First run: npm install sha3 and then sudo ...READ MORE

answered Oct 24, 2018 in Blockchain by Omkar
• 69,220 points
1,068 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,385 views
0 votes
1 answer

Cant get a specific value in JSON/PHP

Convert the json-string to a php-array and ...READ MORE

answered Sep 11, 2018 in Blockchain by slayer
• 29,370 points
2,852 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,900 views
0 votes
2 answers

Coinbase-php createButton() throws 401 error

I found the explanation for this on ...READ MORE

answered Aug 30, 2018 in Blockchain by Naman
1,048 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP