O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validating Forms with JavaScript

JavaScript is not a true security measure in itself, but rather an added level of security and a convenience to your users. Because JavaScript is a client-side technology (whereas PHP is server-side), incorporating it into your pages can save users the hassle of having to submit a form to the Web server, have it checked by PHP, and have the data sent back upon errors. Instead, you can use JavaScript to immediately run through some tests and then, if the data passes, send the form information along to PHP. However, JavaScript does this at the cost of a larger file size for the user to initially download.

I say that JavaScript in itself is not a security measure because it can be easily turned off in a user's browser ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required