Is it better to validate user input before it\'s sent to the server with JS or server side with PHP? Or maybe it\'s worth doing both just to be on the safe side?
I\'
Do both.
Client side gives the responsiveness users expect and server side protects your data.
I'm sure PHP has some libraries that would help you much like what ASP.NET MVC does to provide a way of doing both in one step.