php_guy Posted October 26, 2010 Share Posted October 26, 2010 I'm in the habit of verifying input client side. For example, there is a field to enter a number, and I ensure that it is within a particular range using Javascript. My backend PHP code does not do such checking... Is this bad? Should I be doing checking using my backend code and send a response back to the client to display a message? Admittedly, I avoid it, since it's a little extra work -- well more extra than just javascripts, IF-THEN-ALERT type statement. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 26, 2010 Share Posted October 26, 2010 my opinion: always check server-side. if you have the time and/or desire, add client-side. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 26, 2010 Share Posted October 26, 2010 Done properly, client-side checks can make it more convenient for the user to fill out a form. Done improperly, they can be irritating enough to cause the user to simply leave and not return. Client-side checks really can't be considered validation at all, though. It needs to be done server-side. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.