Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $var=grab("var", "");
- echo $var;
- function striparray($array)
- {
- return is_array($array) ? array_map('striparray', $array) : stripslashes($array);
- }
- function disable_magic_quotes()
- {
- if (get_magic_quotes_runtime())
- set_magic_quotes_runtime(0);
- if (get_magic_quotes_gpc())
- {
- $_GET = striparray($_GET);
- $_POST = striparray($_POST);
- $_COOKIE = striparray($_COOKIE);
- $_REQUEST = striparray($_REQUEST);
- }
- }
- disable_magic_quotes();
- function grab ($name,$def="-"){
- if(isset($_POST[$name]))
- $val = htmlentities(mysql_real_escape_string($_POST[$name]),ENT_QUOTES);
- elseif(isset($_GET[$name]))
- $val = htmlentities(mysql_real_escape_string($_GET[$name]),ENT_QUOTES);
- else
- $val = $def;
- return $val;
- }
- ?>
Add Comment
Please, Sign In to add comment