function print_header($title = ' ', $script = '', $subdir = false, $ismobile = false) { $user = unserialize($_SESSION['user_class']); get_online($user->id); header("Cache-Control: no-store, no-cache, must-revalidate"); ?> <!doctype html> <html lang="ru" dir="ltl"> <head> <title><?php echo $title; ?> </title> <meta charset="utf-8"> <?php /*if($subdir) { print '<link rel="stylesheet" type="text/css" href="../style.php?c='.$user->colors.'"/>'; } else { print '<link rel="stylesheet" type="text/css" href="style.php?c='.$user->colors.'"/>'; }*/ print '<link rel="stylesheet" type="text/css" href="' . LPU_HOST . 'style.php?c=' . $user->colors . '"/>'; switch (get_browser_info()) { case 'Chrome': case 'Opera': break; default: echo '<link rel="stylesheet" type="text/css" href="' . LPU_HOST . 'calendar/calendar.css"><script src="' . LPU_HOST . 'calendar/calendar.js" type="text/javascript"></script>'; } ?> <script type="text/javascript"> <?php print $script; ?> </script> <?php if ($ismobile) { print '<link rel="stylesheet" href="css/jquery.sidr.dark.css">'; print '</head><body> <!-- Include jQuery --> <!--<script src="js/jquery.js"></script>--> <script src="js/jquery-2.1.1.js"></script> <!-- Include the Sidr JS --> <script src="js/jquery.sidr.min.js"></script> '; } else { print '</head><body>'; } $start_time = microtime(); $start_array = explode(" ", $start_time); $GLOBALS['start_time'] = $start_array[1] + $start_array[0]; }
public function onBeforeWrite() { parent::onBeforeWrite(); $browser = get_browser_info(); $this->UserAgent = $browser['user_agent']; $this->Browser = $browser['name']; $this->BrowserVersion = $browser['version']; $this->Platform = $browser['platform']; $this->Referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $this->RemoteIP = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $this->UserID = Member::currentUserID(); $this->ViewDay = date('d'); $this->ViewDayName = date('l'); $this->ViewMonth = date('F'); $this->ViewYear = date('Y'); }
function send_file($file_name, $file_path) { @session_write_close(); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); if (get_user_os() == "MAC") { header("Content-Type: application/x-unknown\n"); header("Content-Disposition: attachment; filename=\"" . $file_name . "\"\n"); } elseif (get_browser_info() == "MSIE") { $disposition = !preg_match("/\\.zip\$/i", $file_name) ? 'attachment' : 'inline'; header("Content-Disposition: {$disposition}; filename=\"" . $file_name . "\"\n"); header("Content-Type: application/x-ms-download\n"); } else { header("Content-Disposition: attachment; filename=\"" . $file_name . "\"\n"); header("Content-Type: application/octet-stream\n"); } $file_path = fix_file_path($file_path); if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0 && !@ini_get('zlib.output_compression') && !@ini_get('output_handler')) { header("Content-Length: " . $filesize . "\n\n"); } @readfile($file_path); }
function is_browser_platform($platform = '') { if ($platform) { $platform = strtolower($platform); $curr_platform = get_browser_info('platform'); if ($curr_platform == $platform) { $true = true; } else { if ($platform == 'ios' && in_array($curr_platform, array('iphone', 'ipod', 'ipad'))) { $true = true; } } $true = trim($true); if (!empty($true)) { return true; } else { return false; } } }
$php_http_user_agent = $_SERVER['HTTP_USER_AGENT']; if (isset($_REQUEST['http_referer'])) { $php_http_referer = base64_decode($_REQUEST['http_referer']); } $ua_os_family = "unknown"; $ua_os_version = "unknown"; $ua_os_platform = "unknown"; $ua_browser_wow64 = "unknown"; $ua_browser_name = "unknown"; $ua_browser_version = "unknown"; $ua_os_info = get_os_info($php_http_user_agent); $ua_os_family = $ua_os_info['family']; $ua_os_version = $ua_os_info['version']; $ua_os_platform = $ua_os_info['platform']; $ua_browser_wow64 = $ua_os_info['wow64']; $ua_browser_info = get_browser_info($php_http_user_agent); $ua_browser_name = $ua_browser_info['name']; $ua_browser_version = $ua_browser_info['version']; $me_mshtml_build = "unknown"; if (isset($_REQUEST['me_mshtml_build'])) { $me_mshtml_build = $_REQUEST['me_mshtml_build']; } $be_office = "unknown"; if (isset($_REQUEST['be_office'])) { $be_office = $_REQUEST['be_office']; } $pd_os = "unknown"; $pd_br = "unknown"; $pd_br_ver = "unknown"; $pd_br_ver_full = "unknown"; $pd_reader = "unknown";
<?php require 'php/header.php'; ?> <h2>Tehtävä 0: Koenauhoitus</h2> <p> Tervetuloa kokeilemaan varhaista kehitysprototyyppiä puhutun vieraan kielen ylioppilaskoejärjestelmästä! Ensin tarkistamme, että tekniikka toimii. <p> Selaimesi on: <?php require 'php/get_browser_info.php'; $ua = get_browser_info(); echo "<b>" . $ua['name'] . "</b> " . $ua['version'] . " (" . $ua['platform'] . "). "; // reports: <br >" . $ua['userAgent'] ; if ($ua['name'] == "Google Chrome") { ?> Tämä on hyvä. <?php } else { ?> <span class=warning> Tästä tulee vielä sanomista! Nauhoitus ja/tai videoiden näyttäminen voi tuottaa ongelmia. Google Chrome (versio 30 tai uudempi) olisi parempi.</span> <?php } ?> <p> Ohjeet: <ul> <li> Oikeassa alakulmassa näet videokuvan ja äänen tasomonitorin. <li>Kun puhut mikrofoniin, monitorin pitäisi aaltoilla puheesi mukaan. Monitorin sivussa näkyvä palkki ilmoittaa sopivasta äänenpainetasosta.
if (!empty($config[anti_scrapping_addon_name]['scrapper_user_agent_likes'])) { $scrapper_user_agents = explode("\n", $config[anti_scrapping_addon_name]['scrapper_user_agent_likes']); $user_agent = strtolower($HTTP_USER_AGENT); if (is_array($scrapper_user_agents)) { foreach ($scrapper_user_agents as $value) { if (strpos($user_agent, strtolower(trim($value))) !== FALSE) { define("IS_ANTISCRAPE_ROBOT", TRUE); break; } } } } if (!empty($config[anti_scrapping_addon_name]['scrapper_ips']) && !defined("IS_ANTISCRAPE_ROBOT")) { $scrapper_ips = explode("\n", $config[anti_scrapping_addon_name]['scrapper_ips']); if (!empty($CLIENT_IP)) { foreach ($scrapper_ips as $value) { if ($CLIENT_IP == trim($value)) { define("IS_ANTISCRAPE_ROBOT", TRUE); break; } } } } if (empty($is_robot) && !empty($HTTP_USER_AGENT) && !defined("IS_ROBOT") && defined("IS_ANTISCRAPE_ROBOT")) { include $app_main_dir . '/include/lib/php-browser-detection.php'; $browser = get_browser_info(); $browser['is_robot'] = $is_robot = 'Other bots'; define("IS_ROBOT", $is_robot); $smarty->assign('browser', $browser); $smarty->assign('is_robot', constant('IS_ROBOT')); }
/** * Method getBrowserInfo * @access private * @return mixed * @since 1.1.8 */ private function getBrowserInfo() { if ($this->browser == null && $this->getBrowserUserAgent() != "") { if (isset($_SESSION['browser_info'])) { $this->browser = $_SESSION['browser_info']; } else { $this->browser = get_browser_info(null, true); $_SESSION['browser_info'] = $this->browser; } } return $this->browser; }