Client-side vs. server-side validation

preview_player
Показать описание

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:

Documentation shown in the video:

cURL:
Рекомендации по теме
Комментарии
Автор

Thanks, this video was quite helpful for me to understand the difference between those validations.

golcuk
Автор

Thank you sir dave for the info, I learn a lot from your explanation.

ronaldroll
Автор

I meant what are the specific parameters of id (integer 11?) and email (varchar(255)?) and indexes (id is PRIMARY?). This will help following your tutorial

robertbradford
Автор

Hi Dave, Please can you make a tutorial on applied OOP in PHP. By "applied " I mean like making login system or any real world example and not class car --> new car audi. Thanks a lot.

sherazkhan
Автор

Would you be inclined to use filter_var to sanitise all incoming form data from text input fields Dave ??? Ie search input, text input and so forth.

cd
Автор

Amazing! thank you for the tutorial very well explained. I have a question, how do you keep your database from SQL Injections?

hunternova
Автор

Dave, I am creating a website for a uni project. I am trying to create a registration page! I want to have the ability to select two types of user, one user will have additional functionality and more details will be stored in another table! I am struggling to get my second insert to work, any ideas?

aidenmurphy
Автор

Bro, help me, I have a website in which I have a product submission form, what i want to do is, I want to disable some feild of it for editing after submission but the method I am using is readonly or disable field which can be easily bypassed by inspect element by deleteing the read only or diabled function. Help me.

globaltradelive
Автор

Hi Daveh, How I would validate an existent record (for example an ID record) in a database.?

oscaralba
Автор

Dave, can you please show how to create the validation_demo database with the subscriber table

robertbradford
Автор

I cannot get this portion of form.php to work at 3:51 in the video:


<script>

document.querySelector("form").addEventListener("submit", function(event) {

if == -1) {

alert("invalid email address");
event.preventDefault();
}
});

</script>

robertbradford
Автор

What if the email address is a fake one and is not a valid email address then how can i ensure that it is a valid email address that has been put by the client, i mean their should be somekind of an otp kind of system or stuff like that to ensure that email address is a real ones not fake but my question is how to make it possible ???
Pls help

saptarshidas