Guest User

Untitled

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. $var=grab("var", "");
  3. echo $var;
  4.  
  5.  
  6. function striparray($array)
  7. {
  8. return is_array($array) ? array_map('striparray', $array) : stripslashes($array);
  9. }
  10.  
  11. function disable_magic_quotes()
  12. {
  13. if (get_magic_quotes_runtime())
  14. set_magic_quotes_runtime(0);
  15. if (get_magic_quotes_gpc())
  16. {
  17. $_GET = striparray($_GET);
  18. $_POST = striparray($_POST);
  19. $_COOKIE = striparray($_COOKIE);
  20. $_REQUEST = striparray($_REQUEST);
  21. }
  22. }
  23. disable_magic_quotes();
  24.  
  25. function grab ($name,$def="-"){
  26. if(isset($_POST[$name]))
  27. $val = htmlentities(mysql_real_escape_string($_POST[$name]),ENT_QUOTES);
  28. elseif(isset($_GET[$name]))
  29. $val = htmlentities(mysql_real_escape_string($_GET[$name]),ENT_QUOTES);
  30. else
  31. $val = $def;
  32. return $val;
  33. }
  34.  
  35.  
  36.  
  37. ?>
Add Comment
Please, Sign In to add comment