PHP protection of GET parameters

前端 未结 3 1206
故里飘歌
故里飘歌 2020-12-10 15:34

OK consider this url:

example.com/single.php?id=21424

It\'s pretty obvious to you and i that the PHP is going to take the id and run it thr

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 16:12

    Of course, never ever ever consider a user entry (_GET, _POST, _COOKIE, etc) as safe.

    Use mysql_real_escape_string php function to sanitize your variables: http://php.net/manual/en/function.mysql-real-escape-string.php

    About SQL injections : http://en.wikipedia.org/wiki/SQL_injection

提交回复
热议问题