0

I am trying to run the following code

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

but it will not work. it does however work when i replace $betamount with an actual number ie

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

or

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

any ideas on whats going wrong ? the $_POST['bet'] is defiantly a number because i have tried multiplying in php and it all works fine.

0

Fixed this now, All you have to do is change it to this

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

for numbers

and this

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

for strings

0

Admin isnt a variable so its a string.

Strings should be in quotes so it should be.

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

http://php.net/manual/en/language.types.string.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.