|
The take home message is always always ALWAYS do the following...
1. Filter input e.g. Make sure you receive a value you are expecting -it could be a number, only letters, more then 30 characters, less than or equal to 2 or whatever etc.
2. Escape output e.g. use htmlentities() for anything going to the browser. This way if there's any dirty code (as a result of your site being hacked) this will deactivate it before it reaches the browser.
Strictly speaking if you filter input correctly then you won't need to escape output. But ALWAYS do both. It's good to read up on how each vulnerability works but if you live by these rules you won't go far wrong!
|