Preventing JavaScript Injections in a PHP Web Application

后端 未结 5 659
生来不讨喜
生来不讨喜 2020-12-31 13:48

What are the measures needed to prevent or to stop JavaScript injections from happening in a PHP Web application so that sensitive information is not given out (best-practic

5条回答
  •  粉色の甜心
    2020-12-31 14:15

    This question already have some answers accepted and rated by users.

    Instead I am also posting an answer, hope this will work fine.

    This is tested by me.

    $value = preg_replace("/[\'\")(;|`,<>]/", "", $value); 
    

    preg_replace() function works perfectly here.

提交回复
热议问题