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,050 points
33 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
• 27,630 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 5, 2018 in Blockchain by ariaholic
• 7,340 points
80 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,050 points
88 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
• 67,290 points
128 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
• 67,290 points
43 views
0 votes
1 answer

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

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
63 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,050 points
119 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
126 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
33 views