mysql_escape_string whole post array?

前端 未结 4 756
野趣味
野趣味 2021-01-02 06:10

I was wondering is it possible to just my_sql_escape string the whole $_POST and $_GET array so you dont miss any variables?

Not sure how to test it or I would\'ve m

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 06:28

    Try This

    foreach(array_keys($_GET) as $key){ $_GET[$key] = mysql_real_escape_string($_GET[$key]);}
    foreach(array_keys($_POST) as $key){ $_POST[$key] = mysql_real_escape_string($_POST[$key]);}
    

    To mysql_real_escape_string Whole

提交回复
热议问题