I'm trying to call data from the Google Calendar API with help from this tutorial and it's returning getting a php error:
Fatal error: Call to undefined function: simplexml_load_file() in \NAWINFS02\home\users\web\b872\rh.urbanpromise\new\loadcalendar.php on line 9
The server is running PHP Version 4.4.8
System: Windows NT IIS01501 5.2 build 3790
The website is currently hosted at readyhosting.com (I'm in the process of switching to a better host)
Any ideas on how to fix the error? (Thanks in advance)
This is my current code:
<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>