//ini_set('display_errors','off'); //error_reporting(0); // Create the function, so you can use it function isMobile() { return preg_match("/\b(?:a(?:ndroid|vantgo)|b(?:lackberry|olt|o?ost)|cricket|docomo|hiptop|i(?:emobile|p[ao]d)|kitkat|m(?:ini|obi)|palm|(?:i|smart|windows )phone|symbian|up\.(?:browser|link)|tablet(?: browser| pc)|(?:hp-|rim |sony )tablet|w(?:ebos|indows ce|os))/i", $_SERVER["HTTP_USER_AGENT"]); } // If the user is on a mobile device, redirect them if(isMobile()){ header("Location: http://m.vanelaschool.com/"); } require("include/conn.php"); ?>