0
<?php 
// Display the error message according to each data code.
$xml = '<?xml version="1.0" encoding="utf-8"?><results>'; 
if($_GET['code'] == "500"){
    $xml .= '<error id="500" message="Error 500"></error>';     
}else if($_GET['code'] == "501"){
    $xml .= '<error id="501" message="Error 501"></error>'; 
}
$xml .= '</results>';
header ("Content-Type:text/xml"); 
echo ($xml);  
?>

我收到了这个错误

This page contains the following errors:

error on line 3 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.

明文形式

<?xml version="1.0" encoding="UTF-8"?><results><error id="501" message="Invalid Course Code"></error>   </results>  
   <!-- Hosting24 Analytics Code -->
   <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
   <!-- End Of Analytics Code -->
4

1 回答 1

0

它适用于您的 WAMPP 服务器,因为它不输出您的主机似乎添加的分析代码:

   <!-- Hosting24 Analytics Code -->
   <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
   <!-- End Of Analytics Code -->

请联系您的主机商,了解如何从您的输出中删除它(或者更好的是,切换主机,因为这有点离谱)。

于 2013-02-22T12:53:50.730 回答