Note that there are some explanatory texts on larger screens.

plurals
  1. USSmarties89
    primarykey
    data
    text
    plurals
    1. COIf you program your javascript correctly, short answer yes. I a regex validation of usernames on my site, which makes it impossible to send a request for making a new user unless it is validated correctly. If I get a request which does not validate on the server, it is highly likely that the person has a malicious purpose. And I just send back a header, saying the server made some unintentional error(like it was a coding error). This is of course not the only security you should have, but it helps keeping lot of script kiddies at bay, by let them search for a hole, there simply isn't at there.
      singulars
    2. COWhat I find is good pratice is to: 1. Validate in the browser 2. Validate on the server with the exact same regex. If it fails, you know it is a person of malicious interest, and that you should log it. Beside that throw a internal server error, so the person will think he caused something to happen. It will waste lot of his/hers time.
      singulars
    3. COYes Blackcat, that is the purpose of try, except. Because you can continue executing the normal code, you have to do some error handling. If it is a minor error and you want to continue, you should use tryParse as JRC says. So example if I write "q" in, and you just want to replace my value by 0, you could do a tryParse, if it fails then just set the value to 0.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload