I want to get some xml data from another server and process it for my own page.
So, to get startet I do something like this:
PHP Code:
$url = 'http://picasaweb.google.com/data/feed/base/user/jonas.ellehauge?kind=photo&max-results=5&start-index=600&thumbsize=400';
$xml = file_get_contents($url);
echo $xml;
Which happens to return different xml compared to if I put the same URL in my browser - i.e. less xml without the links etc I am looking for.
I tried extending it a bit, like this:
PHP Code:
$opts = array('http' =>
array(
'method' => 'GET',
'user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)'
)
);
$context = stream_context_create($opts);
$xml = file_get_contents($url, null, $context);
echo $xml;
- pretending to be a browser. That doesn't work either.
If I do it with a different webservice, i.e. this:
PHP Code:
$url = "http://kort.arealinfo.dk/wms?service=wms&servicename=landsdaekkende_wms&VERSION=1.1.1&REQUEST=GetCapabilities";
- It works fine - I get the same as I would in the browser.
Any suggestions what I might do?
Bookmarks