Parsing Dynamic XML into PHP & HTML

admin

Administrator
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.
 

GigaGreg

Moderator
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.

http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php
http://www.html5rocks.com/en/tutorials/offline/storage/
http://html.net/tutorials/asp/lesson19.asp
http://www.ibm.com/developerworks/library/x-xmlphp2/

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.
 

jaran

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.
PHP:
<?php 
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.