Jump to content

Get remote XML doc


Utherr12

Recommended Posts

Ok...I have googled and got numerous methods on how to get the contents of a page...none worked. One stated that working with file_get_contents or fopen works. In my code I get "no such file".I tried XMLReader, i got XMLReader::open(): Unable to open source data.How DO I get that remote document as a string?

Link to comment
Share on other sites

I am sure I'm not lol... I can access it anytime in my browser. (it's a php script that spits a xml-formatted string)LE: file_get_contents(0): failed to open stream: No such file or directory

Link to comment
Share on other sites

Well, if the option on your server is enabled to open remote files using fopen, then all you need to do is use file_get_contents with the URL. e.g.:$response = file_get_contents('http://www.google.com');

file_get_contents(0): failed to open stream: No such file or directory
That claims you are trying to open a file called "0".
Link to comment
Share on other sites

$plugin = isset($_REQUEST['_plugin']) ? trim(strip_tags($_REQUEST['_plugin'])) : 'z';$remote = file_get_contents(urlencode("http://www.dokuwiki.org/lib/plugins/pluginrepo/repository.php?plugins="+$plugin));$xml = new XMLReader;$xml->XML($remote);$xml->close();

Warning: file_get_contents(0): failed to open stream

Link to comment
Share on other sites

omg... Damn javascript, sorry. It happens a lot when I switch from javascript to php (but not the other way around).Nevermind :)... i got the last error because i didn't include http://

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...