File: /home2/yenicep/public_html/stores.php
<?php
$iPod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
function redirect($url){
if (!headers_sent()){
header('Location: '.$url);
exit;
} else {
echo '<script type="text/javascript">';
echo 'window.location.href="'.$url.'";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>'; exit;
}
}
if($iPad||$iPhone||$iPod){
$url = "https://apps.apple.com/us/app/yenicep-kasko/id6444737334";
redirect($url);
} elseif($android){
$url = "https://play.google.com/store/apps/details?id=com.ekspar.kasko.yenicep";
redirect($url);
} else {
$url = "https://play.google.com/store/apps/details?id=com.ekspar.kasko.yenicep";
redirect($url);
}
?>