+ 2
What are the differences between server side verification and client side verification?
9 Antworten
+ 1
PHP works after submission.
When you load a page, JS scripts runs through that page. There are different coding's you can use. But JS can keep running a function without the need of refreshing the page. Sorry if I don't explain well.
Let me explain your code in that might help:
The code you've written basically validates the values of two inputs. It's written in JS, which means, when you click on the button, the page doesn't get refreshed. The JS tries to validate the inputs and as it is client side, it doesn't need to reload the page to run the function.
But when the JS validates the inputs, then the page reloads and goes to another page that is in PHP to register the user.
__ THE PROCESS
users clicks on the button and the JS validates the inputs without reloading, JS allows the page to go to main.php for registering the user.
I hope this helps.
Let me know if you have any other questions. Always happy to help.
+ 4
Do you mean validation?
Server-side validation is carried out on the server and its more secure unlike client-side where javascript can be disabled and forms cannot be validated. Client-side validation is carried out on the client-side by the client-side language which is done with javascript.
Server-side validation can also be disabled or messed with using XSS(Cross site scripting) attacks
+ 3
Mahdi Maymandi I think JS works after submission.
I am getting more confused 😕😕😕
https://code.sololearn.com/w9yBe2L6BpX3/?ref=app
+ 3
Modi Krishna Teja Yeluripati sir, would you please make these things clear, please?
+ 3
Mahdi Maymandi thank you so much for your help..... This will surely help me....
I finally understood the concept...
thank you very much 😀
+ 2
Mahdi Maymandi let us consider another scenario....
when someone forgets his/her fb password then for verification of the user's account fb sends a code to his/her email address. And he/she can use that code to verify his/her account.....
so is it client side verification, why?
+ 1
The difference is between the process. PHP does it using the server while JS doesn't use the server. If you need to access the server you need to do it with PHP. For example saving something on the database.
+ 1
Mahdi Maymandi let's consider an example... while creating a fb account, we have to create a password then we have to re-enter the password where it is matched with a previous password after clicking the submit button....
so this validation is client side or server side?
0
The details you've given is not enough. The code is very necessary. But usually both of the scenarios you said, both are made out of client side and server side.
For example using JS before submitting the form, the code tells you if your password matched or does not. This is client side. But when the password is reset, or the user is registered on the site, PHP uses the database to save all of these actions.
(Considering the website uses PHP and JS. There are websites that use other languages).