Home  >  Article  >  Backend Development  >  php function get_magic_quotes_gpc

php function get_magic_quotes_gpc

WBOY
WBOYOriginal
2016-07-25 08:51:54847browse
  1. echo get_magic_quotes_gpc(); // Sorry, mine is 0
  2. echo $_POST['lastname']; / / Simao'pig
  3. echo addslashes($_POST['lastname']); // Simao'pig

  4. if (!get_magic_quotes_gpc()) {

  5. $lastname = addslashes($_POST['lastname ']);
  6. } else {
  7. $lastname = $_POST['lastname'];
  8. }

  9. echo $lastname; // Simao'pig

  10. $sql = "INSERT INTO lastnames ( lastname) VALUES ('$lastname')";
  11. ?>

Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn