Hi,
I am beginning to validate user entered data. One thing I want to do is create a function that will only allow users to only enter [A-z], [0-9], spaces, carriage return, tab, comma, period, question and explanation mark. Anything other than that will get rejected.
- Is this a good way to keep my site somewhat secure?
- is this preg_match code set correctly?
$passedVariable = $_POST['passedVariable']
if (!preg_match('/^[a-zA-Z0-9 \n\,\r\t\.\?\!]{1,}$/', $passedVariable)) exit();
Is there anything unsafe about this?
Thanks!