|
User input is by far something that should deserve a lot of attention as user mistakes and malicious interaction can cause some unwanted results for php scripts that don't handle them properly. Sanitizing and type casting vars is usually far too often neglected by those who are first learning php or programming in general.
One of the best ways you can protect user input to behave as the developer expects is to force it to a desired type. For example:
Numbers:
Signed floats
Unsigned floats
Signed Integers
Unsigned Integers
Strings:
Striped or unstriped
Trimmed
Untrimmed
HTML Safe
Booleans
Arrays
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|