アプリ版:「スタンプのみでお礼する」機能のリリースについて

すみません、エージェント振り分けで以下のようにPHPファイルを作りました。
そして各ホルダ i,s にindex.htmlを配置したところ
Warning:Cannot modify header information headers already sent by (output started at /home/lolipop,jp-dp44253830/web/mobile/index.php:1) in/home/sites/lolipop.jp/users/lolipop.jp-dp44253830/web/mobile/index.php on line 4


index.php
<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match("/^DoCoMo/i", $agent)){
header("Location: http://homepege.net/mobile/i/index.html");
exit;
}else if(preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $agent)){
header("Location: http://homepage.net/mobile/s/index.html");
exit;
省略
}
?>


お手数ですが教えてください。

A 回答 (1件)

header関数は、何かを出力してしまってからは呼べません。


見たところ何も出力していないように見えるのですが、<?php の前に空白や改行があるとか?
    • good
    • 0
この回答へのお礼

なるほど、勉強不足でした。どうりで以前大丈夫だったのに
<?php の前に書き込み、消した後エラーが出たわけですね。
notnotさんたすかりました、ありがとうございます。

お礼日時:2009/07/17 22:17

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!