function q($query) { debug($query); init_mysql(); $r = mysql_query($query); if (!$r) { debug(mysql_error()); } return $r; }
<?php include '../etc/utils.php'; include '../etc/constants.php'; require_once '../etc/ext/MobileDetect/Mobile_Detect.php'; init_mysql(); // Set locale and validate $locale = retrieve_from_get($proto_locale, false); if (is_null($locale)) { if (isset($_COOKIE[$proto_locale])) { $locale = validateLocale($_COOKIE[$proto_locale]); } else { $locale = $proto_locale_english; } } else { // Locale is enforced, save it to cookie. $locale = validateLocale($locale); setcookie($proto_locale, $locale, time() + $cookie_expiry); } include "../etc/locale/tirtayasa_{$locale}.php"; // Set region and validate $region = retrieve_from_get($proto_region, false); if (is_null($region)) { if (isset($_COOKIE[$proto_region])) { $region = validateRegion($_COOKIE[$proto_region]); } else { $region = $proto_region_bandung; } } else { // region is enforced, save it to cookie. $region = validateRegion($region);