If you are using php, then server-side validation is always better as client side validation can be tampered with.
So you just need to check if $_POST("variable")
has been validated otherwise return an error.
You may follow this example - PHP Form Validation