POST[''pw'']; $sql = “select count(*) as ctr from users where username=''”.$username.”'' and password=''”. $pw.”'' limit 1″; $result = mysql_query($sql); while ($data = mysql_fetch_object($result)){ if ($data->ctr == 1){ //they''re okay to enter the application! $okay = 1; } } if ($okay){ PHP开发不能违背的安全规则 过滤用户输入_网学
POST[''pw'']; $sql = “select count(*) as ctr from users where username=''”.mysql_real_escape_string($username).”'' and password=''”. mysql_real_escape_string($pw).”'' limit 1″; $result = mysql_query($sql); while ($data = mysql_fetch_object($result)){ if ($data->ctr == 1){ //they''re