リモート サーバーで XML ファイルを開こうとしていますが、リダイレクトの制限に達したというエラーが表示されます。リモコンを制御できないので、その制限を増やす方法はありますか? または、サーバーの所有者と話をして、彼らができることを確認する必要がありますか?
これはエラーです:
警告: simplexml_load_file( http://www.server.com/search/music.xml?key=key&type=songs&p1=All%20Things%20New&p2=Elevation%20Worship ) [function.simplexml-load-file]: ストリームを開けませんでした: リダイレクトの制限に達しました。4 行目の /home/admin/public_html/art/art.php で中止します
警告: simplexml_load_file() [function.simplexml-load-file]: I/O 警告: 外部エンティティの読み込みに失敗しました " http://www.server.com/search/music.xml?key=key&type=songs&p1=All% 20Things%20New&p2=Elevation%20Worship " /home/admin/public_html/art/art.php の 4 行目
致命的なエラー: 6 行目の /home/admin/public_html/art/art.php の非オブジェクトに対するメンバー関数 xpath() の呼び出し
私のコードは次のとおりです。
<?php
function errorHandler($n, $m, $f, $l) {
header('Location: blank.png');
}
set_error_handler('errorHandler');
$url = 'http://REMOTESERVER/search/music.xml?key=KEY&type=songs&p1=' . htmlspecialchars($_GET["track"]) . '&p2=' . htmlspecialchars($_GET["artist"]) . '';
$xml = simplexml_load_file($url);
$img = $xml->xpath('//image200');
$large = (string)$img[0];
header("Location:".urldecode($large));
?>