Client-side vs. server-side validation

Опубликовано: 14 Ноябрь 2024
на канале: Dave Hollingworth
14,683
268

PHP for Beginners course: ➤ https://davehollingworth.net/phpy
PHP MVC course: ► https://davehollingworth.net/phpmvcy

In a web application, which is better, client-side or server-side validation?

In this video we'll see examples of both, using JavaScript in the browser and PHP on the server.

We'll also learn how client-side validation can be bypassed, first by deactivating JavaScript in the browser, then by using the cURL command-line too.

Finally we'll conclude that validation on the server is essential, to protect against malicious users who might be trying to bypass your code. Client-side validation is there to give better feedback to users, and to make your application faster.

Code shown in the video:
https://gist.github.com/daveh/e8565a0...

Documentation shown in the video:

cURL:
https://curl.haxx.se/