You are here: Re: Value greater than value issue « PHP Programming Language « IT news, forums, messages
Re: Value greater than value issue

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация