case "opera": $version = str_replace("/", "", substr($match[1][0], 0, 5)); break; case "navigator": $version = substr($match[1][0], 1, 7); break; case "maxthon": $version = str_replace(")", "", $match[1][0]); break; case "google chrome": $version = substr($match[1][0], 1, 10); } return $version; } function Plugindownload() { $switch = $this->info['Operating System']; switch ($switch) { case "Windows": header("Location: http://brainmetrics.emotivinsight.com/Download/EmotivLifeSciences.msi"); break; case "Mac": header("Location: http://brainmetrics.emotivinsight.com/Download/EmotivLifeSciences.dmg"); break; default: break; } } } $obj = new OS_BR(); $obj->Plugindownload();
function insertNewUser($db) { // using // create an new instant of OS_BR class $obj = new OS_BR(); // // if you want to show one by one information then try showInfo() function // get browser $name = $obj->showInfo('browser'); // get browser version $version = $obj->showInfo('version'); // get Operating system $so = $obj->showInfo('os'); $ip = getIP(); $sql = "INSERT INTO user (browser_name, browser_version, operating_system, ip) VALUES ('{$name}', '{$version}', '{$so}', '{$ip}');"; $db->query($sql); $sql = "SELECT count(*) as last_id FROM user;"; $res = $db->query($sql); $row = $res->fetch_assoc(); return $row['last_id']; }