Variable Casting
I thought I'd do a few small tutorials on data validation. Pretty much all websites now require some sort of user input, be it in the form of a newsletter or user registration, or a shopping cart. Its important that this data that is inputted is validated, else you'll find the wrong sort of data is inputted - either due to a malicious user, or a stupid one!
A lot of people get into PHP as its rather easy to code, but they overlook the most simple of input validation routines to ensure that the data coming from the end user matches what they expect. The golden rule of writing a PHP application is to never trust the user input, whether its come from a form via POST, the URL via GET or even a cookie.
Continue Reading 3 comments December 21st, 2005