|
Posted by Mathias K. on 03/16/07 11:06
Am 16 Mar 2007 02:47:32 -0700 schrieb Aggelos:
> Hello,
> First of all I want to say I do not have very clear understanding of
> XML and PHP and what you can do with those two.
> Now the problem I have is:
> There is that booking company that sends data to me via XML and I have
> in my server to read that XML and store it in a DB.
> What I have no Idea how to do is read that XML.
> To start with, I though they were using $_POST to upload an XML file,
> but it seems they do not as when I get a request in my script I
> print_r the $_POST and it is empty. The same with $_GET, empty.
>
> Do you have any idea of other ways that they might send the XML data
> and how can I read them with a PHP4 script?
>
> Thank you.
Hello Aggelos!
First of all, a short tutorial about uploading (sending it to your server)
files with PHP can be found there:
http://www.phpjabbers.com/file-uploading-with-php-php18.html
When the file is stored on the server you can read it as usual with fopen,
fread, fclose etc.
Of course, if you want to parse the XML file that's a bit more complicated.
I suggest you to look for a class on www.phpclasses.org
A very good class that is also used by Joomla and Mambo CMS (among others)
is DOMIT! XML Parser by John Heinstein:
http://www.phpclasses.org/browse/package/1468.html
Good luck.
~ MK
[Back to original message]
|