【发布时间】:2010-03-04 18:45:05
【问题描述】:
我正在尝试在this tutorial 的帮助下从 Google 日历 API 调用数据,但它返回了一个 php 错误:
致命错误:调用未定义函数:第 9 行 \NAWINFS02\home\users\web\b872\rh.urbanpromise\new\loadcalendar.php 中的 simplexml_load_file()
服务器正在运行 PHP 版本 4.4.8
系统:Windows NT IIS01501 5.2 build 3790
该网站目前托管在 readyhosting.com(我正在切换到更好的主机)
关于如何修复错误的任何想法? (提前致谢)
这是我当前的代码:
<html>
<body>
<?php
$userid = 'username%40googlemail.com';
$magicCookie = 'cookie';
// build feed URL
$feedURL = "http://www.google.com/calendar/feeds/userid/private-magicCookie/basic";
// read feed into SimpleXML object
$sxml = simplexml_load_file($feedURL);
// get number of events
$counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');
$total = $counts->totalResults;
?>
<h1><?php echo $sxml->title; ?></h1>
<?php echo $total; ?> event(s) found.
<p/>
<ol>
<?php
// iterate over entries in category
// print each entry's details
foreach ($sxml->entry as $entry) {
$title = stripslashes($entry->title);
$summary = stripslashes($entry->summary);
echo "<li>\n";
echo "<h2>$title</h2>\n";
echo "$summary <br/>\n";
echo "</li>\n";
}
?>
</ol>
</body>
</html>
【问题讨论】:
-
这和应用引擎有什么关系?