Jump to content

intval is not reading decimals


Monkuar

Recommended Posts

$_POST['amount'] = intval($_POST['amount']);
if ($_POST['amount'] < 0){
message($lang_common['Bad request']);
}
if (!is_numeric($_POST['amount'])){
message($lang_common['Bad request']);
}
echo $pun_user['gold'];
echo '<br>';
echo $_POST['amount'];
exit;

 

if I enter 0.05

in my gold input textbox and submit it, it reads 0, it doesn't read the decimal values, i need it to read them, but I also need it to be secure and use intval.. help

Link to comment
https://forums.phpfreaks.com/topic/257678-intval-is-not-reading-decimals/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.