2017-06-10 15 views
0

私はいくつか理解する必要があり、PHPファイルの問題を解決するために役立つ必要があります、このファイルは、より多くのダウンロードできない古いwhmsonicテンプレートの一部です。新鮮なインストールがあっても解決策はありません。XML構文のエラー - キャッチされない例外 '例外'

これは、それが

PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/radionet/public_html/stats.php:17 
 
Stack trace: 
 
#0 /home/radionet/public_html/stats.php(17): SimpleXMLElement->__construct('<?xml version="...') 
 
#1 {main} 
 
    thrown in /home/radionet/public_html/stats.php on line 17

ライン17ログに私が持っているとエラーになり、ファイル

<?php 
 
include("language/en.php"); 
 
include('config_radio.php'); 
 

 
$ctx = stream_context_create(array(
 
    'http' => array(
 
     'timeout' => 10 
 
     ) 
 
    ) 
 
); 
 

 
    @ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 WHMSonic/2.0.1'); 
 
\t $d = @file_get_contents("http://".$GLOBALS['scip'] . ":" . $GLOBALS['scport'] . "/admin.cgi?mode=viewxml&pass=" . $GLOBALS['scpass'], 10, $GLOBALS['ctx']); 
 
    if (!$d) { 
 
     echo "<font color=66CCFF><b>$GLOBALS[lang9]<br>$GLOBALS[lang8]</b></font>"; exit; } else { 
 

 
\t $shoutcast_xml = new SimpleXMLElement($d); 
 
\t $bitrate = utf8_decode($shoutcast_xml->BITRATE); 
 
\t $streamstatus = utf8_decode($shoutcast_xml->STREAMSTATUS); 
 
\t $currentlisteners = utf8_decode($shoutcast_xml->CURRENTLISTENERS); 
 
\t $servertitle = utf8_decode($shoutcast_xml->SERVERTITLE); 
 
\t $songtitle = utf8_decode($shoutcast_xml->SONGTITLE); 
 
?> 
 
<html> 
 
<head> 
 
<META HTTP-EQUIV="Refresh" CONTENT="25; URL=stats.php"> 
 
<link type="text/css" rel="stylesheet" href="template/style2.css"> 
 
</head> 
 

 
<body style="margin:0px;"> 
 
<div align="center"> 
 
    <?php if($streamstatus == "1"){ echo ""; } else { echo "<font color=66CCFF><b>$GLOBALS[lang7]<br>$GLOBALS[lang8]</b></font>"; exit;} ?> 
 
    <br> 
 
</div> 
 
<table width="90%" border="0" cellspacing="2" cellpadding="0" align="center"> 
 
    <tr> 
 
    <td width="25%"> 
 
     <div align="right"><b><font color="#999999"><?php echo $GLOBALS['lang3'];?>:</font></b></div> 
 
    </td> 
 
    <td width="75%"> 
 
     <?php echo "<font color=FFFFFF><b>$GLOBALS[servertitle]</b></font>"; ?> 
 
    </td> 
 
    </tr> 
 
    <tr> 
 
    <td width="25%"> 
 
     <div align="right"><b><font color="#999999"><?php echo$GLOBALS['servertitle'];?>:</font></b> 
 
     </div> 
 
    </td> 
 
    <td width="75%"> 
 
     <?php echo "<font color=FFFFFF><b>$GLOBALS[songtitle]</b></font>"; ?> 
 
    </td> 
 
    </tr> 
 
    <tr> 
 
    <td width="25%"> 
 
     <div align="right"><b><font color="#999999"><?php echo$GLOBALS['lang5'];?>:</font></b></div> 
 
    </td> 
 
    <td width="75%"> 
 
     <?php echo "<font color=FFFFFF><b>$GLOBALS[bitrate] KBPS</b></font>"; ?> 
 
    </td> 
 
    </tr> 
 
    <tr> 
 
    <td width="25%"> 
 
     <div align="right"><b><font color="#999999"><?php echo$GLOBALS['lang6'];?>:</font></b><font color="#999999"></font> 
 
     </div> 
 
    </td> 
 
    <td width="75%"> 
 
     <?php echo "<font color=FFFFFF><b>$GLOBALS[currentlisteners]</b></font>"; ?> 
 
    </td> 
 
    </tr> 
 
</table> 
 
</body> 
 
</html> 
 
<?php } ?>

アリでしょうです

 echo "<font color=66CCFF><b>$GLOBALS[lang9]<br>$GLOBALS[lang8]</b></font>"; exit; } else { 

私はあなたにそれを解決するための提案をお願いします。私は解決策なしでXML構文ファイルのガイドに従ってalredyを試しました。

echo "<font color=66CCFF><b>$GLOBALS['lang9']<br>$GLOBALS['lang8']</b></font>"; exit; } else { 

は よろしく

答えて

0

あなたは $GLOBALS[]

これを試してみてくださいVARSに引用符を忘れてしまった、どうもありがとうございます

関連する問題