-1

On a form that I made I check a lot of checkbooks and set values accordingly. For example, if checkbox1 is check I set $somevalue equal to Yes, else it is equal to No. I later than call $somevalue in an sql query.

Is this secure? I know you're never supposed to trust user input. I am parsing my input boxes with mysqli_escape_string and checking if drop down boxes contain values I expect. I'm just not positive if I have to do anything extra for my check boxes.

Luke
  • 463
  • 3
  • 9

1 Answers1

0

Sounds like you're doing everything right.

If you have an input string that the user creates, then you should escape the string, however if you're only expecting specific values then you only really need to do the conditional, since once you've verified the text you're dealing with to be "Yes", then you know it doesn't utilize injection.

VortixDev
  • 965
  • 1
  • 10
  • 23