Jump to content

[SOLVED] PHP Vs Javascript


adam84

Recommended Posts

I know totally different, but I just wanted to know if I do all my data validation after my form has been submitted is that considered to be good coding or should I do the validation first in javascript, then recheck everything in PHP. As of now, I am just doing everything in PHP because in a few past posts, people have said to validate the data in PHP because Javascript can be turned off. So if a user can turn their Javascript off, is it even worth validating in Javascript at all?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/117746-solved-php-vs-javascript/
Share on other sites

1.) Always validate server side.

 

2.) Add validation client side so that it is more user friendly. It is far nicer for the user to be told immediately that their username is not long enough than to fill out the rest of the form, wait a while, then be told. Not to mention lighter load on your server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.