Passing values to PHP via XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maniac9
Forum Commoner
Posts: 55
Joined: Fri Aug 01, 2003 12:27 am
Location: Arkansas, USA
Contact:

Passing values to PHP via XML

Post by maniac9 »

Is there a way to send XML data to a PHP script to be parsed, somewhat like using it as an argument. I'm assuming I can't use GET, since the maximum length would most likely be reached, so would posting it via a form work? Anyone have any ideas?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Could you expand a bit on what you're trying to do? PHP can handle XML as a string but I'm not clear on what you are trying to achieve.

Mac
maniac9
Forum Commoner
Posts: 55
Joined: Fri Aug 01, 2003 12:27 am
Location: Arkansas, USA
Contact:

Post by maniac9 »

Somewhat like an API...

I have a PHP script that will return information, like database entries, in the form of XML. What I would also like to do is be able to supply the script input in the form of XML from some other source, like ASP or Flash.
User avatar
Jean-Yves
Forum Contributor
Posts: 148
Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK

Post by Jean-Yves »

If you use POST instead of GET, then the size limitation is less of an issue. Alternatively, you could get the source program to write to a file that is accessible to your PHP code and which could then be opened and used as the xml source.

As far as I know, the xml parser will scan over a character stream, so opening the file or parsing over the xml string sent via POST should work.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

webservices my dear friend (check nusoap)
maniac9
Forum Commoner
Posts: 55
Joined: Fri Aug 01, 2003 12:27 am
Location: Arkansas, USA
Contact:

Post by maniac9 »

With using the POST method, what are the limitations on size?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

depends on what your webserver allows and the value of post_max_size tells
Post Reply