index.phpページの最上部でこのスクリプトを使用しているプラットフォームを検出しようとしていますが、コンピュータのブラウザ(google.comにリダイレクトする必要があります)にアクセスするとリダイレクトされません。この単純なリダイレクトスクリプトはなぜ機能しませんか?
<?php
//Detect special conditions devices
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
$webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
//do something with this information
if($iPod || $iPhone){
header("Location: http://example.com/myOtherPage.php");
}else if($iPad){
//browser reported as an iPad -- do something here
}else if($Android){
header("Location: http://example.com/myOtherPage.php");
}else if($webOS){
header("Location: http://google.com");
}
?>
おかげ
'のvar_dump($ _、SERVER [ 'HTTP_USER_AGENT']を)リダイレクトされていないカテゴリのいずれかに落ちていないので;' - あなたは何を得るのですか? –