$val){ if(!isSuperGlobal($key)) global $$key; } ob_start(); global $basedir; include $basedir . 'pages/' . $i . '.php'; return ob_get_clean(); } function url($url = '') { global $baseurl; return $baseurl . $url; } function url_origin($s, $use_forwarded_host=false) { $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true:false; $sp = strtolower($s['SERVER_PROTOCOL']); $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : ''); $port = $s['SERVER_PORT']; $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port; $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME']); return $protocol . '://' . $host; } function full_url($s, $use_forwarded_host=false) { return url_origin($s, $use_forwarded_host) . $s['REQUEST_URI']; }