jeudi 26 février 2015

How to get the content of a secured remote xml file to work with in Wordpress?

there is a xml-file on a remote server. It is updated daily.

I now need to access this file to work with it.


How I access the file via browser:



  1. Go to http:// example. com /things.xml (had to include the spaces because I need a reputation of 10 to post two urls)

  2. Get a "authentication required"-window and put in username and password

  3. Get redirected to "http://ift.tt/1BAMpVA"

  4. See rendering of XML by browser


I tried file_get_contents('username:password@http://ift.tt/1AbxlGG') and get following output:



E_WARNING : type 2 -- file_get_contents(username:password@http://ift.tt/1AbxlGG) [function.file-get-contents]: failed to open stream: No such file or directory



Even if I would be able to access the file there would be the problem of getting the contents to work inside Wordpress.


My goal is to display a list of "things".


Thank you in advance

(very first post. Hope I haven't made a lot of mistakes)


Mightvision





Aucun commentaire:

Enregistrer un commentaire