$value) { if (!is_array($_POST[$key])) { $_POST[$key] = trim(addslashes($value)); } } } if (isset($_REQUEST)) { foreach ($_REQUEST as $key => $value) { if (!is_array($_REQUEST[$key])) { $_REQUEST[$key] = trim(addslashes($value)); } } } if (isset($_GET)) { foreach ($_GET as $key => $value) { if (!is_array($_GET[$key])) { $_GET[$key] = trim(addslashes($value)); } } } // Ensures these variables aren't vulnerable to SQL injection if (isset($_SERVER['REMOTE_ADDR'])) { $_SERVER['REMOTE_ADDR'] = trim(addslashes($_SERVER['REMOTE_ADDR'])); } if (isset($_SERVER["HTTP_REFERER"])) { $_SERVER["HTTP_REFERER"] = trim(addslashes($_SERVER["HTTP_REFERER"])); } } // Prevent over-writing of globals if (ini_get('register_globals')) { if (isset($_REQUEST['GLOBALS'])) { die('GLOBALS overwrite attempt logged'); } // Variables that shouldn't be unset $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) ? (array)$_SESSION : array()); foreach ($input as $k => $v) { if (!in_array($k, $noUnset) AND isset($GLOBALS[$k])) { unset($GLOBALS[$k]); } } } ?>SELECT bannerid FROM `oto_sqban_iplog` WHERE ipaddress='18.204.2.231' AND imgid='000000' LIMIT 1