php函数get_magic_quotes_gpc
时间:2021-07-01 10:21:17
帮助过:3人阅读
-
-
-
-
- echo get_magic_quotes_gpc(); // 很不好意思,我的这个是0
- echo $_POST['lastname']; // Simao'pig
- echo 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')";
- ?>
|