function sqllogin($con1){ ... if ($row[1]) { // 这里没有对取出的数据进行转义, 就直接返回, 然后在后续存入了session,被直接调用, 导致SQL注入 return $row[1]; } else { return 0; } }