You are here:  » Cant use it. I get error message


Cant use it. I get error message

Submitted by tzic on Mon, 2008-09-15 14:59 in

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?

Submitted by support on Mon, 2008-09-15 15:14

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.