Hello, i am an old customer. I try to use magicParser but I get this error message:
could not open http://www.myhome.gr/forum/rss.php
The address of the feed is www.myhome.gr/forum/rss.php and I use this code:
require("MagicParser.php");
function myRecordHandler($record)
{
// This is where you write your code to process each record, such as loading a database
// You can display the record contents using PHP's internal print_r() function:
print_r($record);
// The following code will print out each field in your sample data:
print $record["ITEM"];
print $record["TITLE"];
print $record["LINK"];
print $record["DESCRIPTION"];
print $record["PUBDATE"];
print $record["GUID"];
print $record["GUID-ISPERMALINK"];
}
MagicParser_parse("http://www.myhome.gr/forum/rss.php","myRecordHandler","xml|RSS/CHANNEL/ITEM/");
print MagicParser_getErrorMessage();
to show it in my main page www.myhome.gr/inex.php
Any ideas?
Hi there,
I'm assuming this is a new project, so maybe you haven't used Magic Parser to open a remote URL on this server before. It sounds like URL Wrappers are not enabled, which means that PHP cannot fopen() a URL, which is what Magic Parser tries to do. Please see this thread for more info and how to enable it (which may involve asking your host):
http://www.magicparser.com/node/189
To confirm if this is the problem, you can try this test script:
<?php
$url = "http://www.myhome.gr/forum/rss.php";
if (!fopen($url,"r"))
{
print "fopen() failed";
}
?>
Hope this helps!
Cheers,
David.