doujuegai8830 2011-08-04 14:09
浏览 9
已采纳

上传我的网站时混淆错误消息

I made a test website in MAMP. And all worked fine.

However, when I uploaded it I got alot of error messages on one crucial page.

The link to see the error messages are:

http://ryanmurphy.org.uk/musicsite/artist.php

I thought it may be useful to see the code for that page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ryan Murphy's Music Website</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/BBC_Radio_1.svg/175px-BBC_Radio_1.svg.png">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen" />
<img src="http://blogs.howtogeek.com/mysticgeek/files/2008/08/618pxlast.fm-logo.svg.preview.png" style="padding-left:10px;">

</head>
<body>
<h1>Most popular artist this week</h1>
<div id="navbar"><ul>
<li><a href="index.php">Home</a></li>
<li><a href="music.php">Track Playlist from the last week</a></li>
<li><a href="artist.php">Most played Artist from the last week</a></li>
<li><a href="sources.html">Sources Used</a></li>

</ul>
</div>

<table>
<th>Artist</th>
<th>Times played this week</th>
<th>Previous plays</th>

<?php
foreach ($xml->artists->children() as $child)
{
  echo "<tr>";
  $artist = (string)$child->name;
  echo "<td>$artist</td>";
  $playedweek = (string)$child->plays;
  echo "<td>$playedweek</td>";
  $previousplays = (string)$child->previous_plays;
  echo "<td>$previousplays</td>"; 
  echo "</tr>";
}?>
</table>
</body>
</html>
  • 写回答

1条回答 默认 最新

  • duanaidang6197 2011-08-04 14:10
    关注

    You do a method call like this:

    $obj->children()
    

    However, $obj is not an object. Try var_dump($obj) to see what it contains.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作