7.7.2 Server-side validationThis is NOT the latest copy of this book; click here for the latest version.
Server-side data validation means using PHP to verify that good values have been sent to the script. Using server-side validation has pretty much the exact opposite pros and cons of client-side development: it is more secure and works seamlessly with all browsers, but it does so at the cost of slightly higher server load and slower feedback for users.
One big advantage to server-side validation is that you can use PHP - a language by now you have attained some skill with. As you know, PHP has a wide variety of functions and language features to help you chop and change strings, check numbers are within ranges, and so on. Furthermore, you can use PHP to connect to a database to check whether a username exists, for example, which is simply impossible using client-side scripting.
|
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.
My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!
|