Is it recommended to have a santizing function that combines two or more built in sanitizing functions in php?

后端 未结 2 1518
天涯浪人
天涯浪人 2021-01-29 03:30

Is it okay to employ a function that sanitizes the incoming inputs due to a form submission or any other request. It is time saving but the question of effectivenss and efficien

2条回答
  •  余生分开走
    2021-01-29 04:11

    each function serves its own purpose, you shouldn't use any function not for their intended use.

    1. you should use mysql_real_escape_string before using the parameter in mysql query.
    2. you should use htmlspecialchars before outputting to page.

    that's about it.

提交回复
热议问题