This question already has an answer here:
Just as the title states. Is it a standard procedure/practice to escape number inputs?
I know text fields should be escaped, but i'm wondering if I need to escape numbers.
</div>
This question already has an answer here:
Just as the title states. Is it a standard procedure/practice to escape number inputs?
I know text fields should be escaped, but i'm wondering if I need to escape numbers.
</div>
收起
You should use Prepared Statement. But if you don't wish to do that, at least cast some data type, for example:
<?php
$myVar = (int)$_POST['user_age'];
$myVar = (float)$_POST['user_salary'];
报告相同问题?