Parsing Dynamic XML into PHP & HTML


Staff member
I have been asked a question to which i`m not fully sure of the answer. We have a client (at work) whom wants to pull data from an external database.

Firstly the xml database file is not wholly downloadable, we can only return requested queries data.

The question is how would I store the requested query data, store the data in the the sql database and return the result onpage in php / html?

I have done a google search which returns dozens of results, which of many are years old which has led me to believe i`m searching wrong or there is a more secure upto date method.


Staff member
This sounds harder than should be.

I have found lots of creative ways of doing this. Most of the time you would use some APIs or libraries.

If I knew PHP I would help, but only just started learning. I think that you should ask the same question on stackoverflow, guys on there might help you.


New member
Im usually using curl to make xml data from my resources. Just change your header into xml then you can build the data as what you want.
header('Content-type: text/xml');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');
You can add an authorize method ( likes api key or similar way) to protect database keep safe.