Monkuar Posted February 24, 2012 Share Posted February 24, 2012 $_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 More sharing options...
PFMaBiSmAd Posted February 24, 2012 Share Posted February 24, 2012 floatval Link to comment https://forums.phpfreaks.com/topic/257678-intval-is-not-reading-decimals/#findComment-1320682 Share on other sites More sharing options...
Monkuar Posted February 24, 2012 Author Share Posted February 24, 2012 floatval you sir have won the internet, congrats Link to comment https://forums.phpfreaks.com/topic/257678-intval-is-not-reading-decimals/#findComment-1320690 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.