Jump to content

Recommended Posts

I'm attempting to read an xml document URL in php, but I keep getting this error:

Warning: simplexml_load_file() [function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\EasyPHP 3.0\www\test.php on line 42

 

Warning: simplexml_load_file(http://isbndb.com/api/books.xml?access_key=6GACLX6U&index1=isbn&value1=9780966807707) [function.simplexml-load-file]: failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\EasyPHP 3.0\www\test.php on line 42

 

The page exists, and I can see the xml document when I open the url, but my program seems unable to find it. Here's the section of code:

 

$isbn = $row['ISBN'];

    $completeurl = 

      "http://isbndb.com/api/books.xml?access_key=6GACLX6U&index1=isbn&value1=" .$isbn; 

  $xml = simplexml_load_file($completeurl, 'SimpleXMLElement', LIBXML_NOCDATA);

   

$tracks = $xml->ISBNdb->BookList->BookData;

Link to comment
https://forums.phpfreaks.com/topic/163623-php_network_getaddress-failed/
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.