キャリア判別
キャリア判別するため見よう見まねで以下の通りindex.phpを作成しまして、i,e,sのフォルダにそれぞれindex.htmlを入れまいが、真白で
何も映りません、なぜでしょうか?教えてください。
<?php
$ua = $_SERVER['HTTP_USER_AGENT'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD Compact HTML 1.0 Draft//EN"><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<meta http-equiv="Content-Language" content="ja">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="cache-control" content="max-age=0">
<META name="keyword" content="">
<META name="description" content="">
<META name="robots"content="index,follow">
</HEAD>
<body>
<?php
switch(TRUE){
case preg_match("/^DoCoMo\/2\.0/i", $ua):
case preg_match("/^DoCoMo\/1\.0/i", $ua):
$carrier = "i";
break;
case preg_match("/^SoftBank/i", $ua):
case preg_match("/^J\-PHONE/i", $ua):
case preg_match("/^Vodafone/i", $ua):
case preg_match("/^MOT/i", $ua):
$carrier = "s";
break;
case preg_match("/^KDDI\-/i", $ua):
case preg_match("/^UP.Browser/i", $ua):
$carrier = "e";
break;
default:
$carrier = "pc";
break;
}
$html_filename = "index.html";
$html_filepath = "templates/" .carriers. "/" .$html_filename;
$output = @file_get_contents($html_filepath);
echo $output;
?>
</body>
</html>