0

サーバーに小さな問題があります。

phpの「ヘッダー」関数を使用すると機能しません:

header('location: /index.html');

同じphpバージョンの別のサーバーでこの行を試しましたが、正常に動作します。

PHPバージョン:5.1.65

何かアドバイスはありますか?

4

3 に答える 3

2
header('Location: /index.html');
                ^---missing colon
于 2012-11-16T15:01:48.107 に答える
1

Dylan Crossが述べたように、ヘッダーの前にHTML出力があってはなりません。

「header」を呼び出す前にライブラリが必要な場合は、注意を払わずにhtmlが含まれている可能性があります。

<?php 

   // Code here

?>{If there is a space after this close tag, it's considered as an HTML output}

この場合、すべてのライブラリをチェックする必要があります...

于 2012-11-27T07:03:23.833 に答える
0

コロン()を逃したこれを試してください:

header('location: /index.html');
于 2012-11-16T15:02:17.940 に答える