Posted by Good Man on 12/07/07 20:14
Acrobatic <jbnunn@gmail.com> wrote in news:7bc09fbf-5b53-4d5d-bfc7-
326fee3c2ba9@d21g2000prf.googlegroups.com:
> Also, if I hard code the values, the script works fine. Somewhere
> between pulling the maximum from the database and getting the
> $_REQUEST variable things are getting lost in translation.
>
> Thanks for any advice
>
my quick suggestion would be to make sure your values really are what you
think they are... echo out to the screen
also, note that "floatval" is a function whereas "float" will evaluate a
string numerically.
so...
<?php
$withdraw_request = (float)$_REQUEST['withdraw_amount'];
$withdraw_maximum = (float)$user['available_balance'];
echo "comparing $withdraw_request and $withdraw_maximum <br>";
if($withdraw_request > $withdraw_maximum) {
echo "Insufficient funds.";
} else {
echo "Processing...";
}
?>
Navigation:
[Reply to this message]
|