echo get_magic_quotes_gpc(); // 很不好意思,我的这个是0echo $_POST['lastname']; // Simao'pigecho addslashes($_POST['lastname']); // Simao'pig if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; } echo $lastname; // Simao'pig $sql = "INSERT INTO lastnames (lastname) VALUES ('$lastname')"; ?> 复制代码