Posting XML from PHP

There is a frequent need to post xml data to a url. Below is shown an example which lets you post xml data using CURL.


Download code

8 thoughts on “Posting XML from PHP

  1. Excellent example. Clear, short, sweet and awesome handwriting font to boot. What font is that?

  2. Wow excellent script but am getting error message “Bad Request (Invalid URL)” am using IP instead domain on URL

    can you help me what went wrong?

  3. Hello. I’m very na├»ve to the idea of HTML, XML, and such. I was wondering if you could simply tell me how to take an XML feed or an HTML feed and automatically have it go to a post on my page? I have it set up already where e-mails automatically go to post, but I would really like to be able to take XML feeds from sports pages and have those automatically go to my posts. I hope I’m not sounding too stupid as I come from the day where I used to set the VCR for my dad. You can e-mail me back at the address I provided and I hope that you might build to provide me with an explanation. I can understand. Thank you very much for your time

  4. Heya just wanted to give you a brief heads up and let you know
    a few of the images aren’t loading properly. I’m
    not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers and both show the same results.

  5. I used this method on a Apache Tomcat/7.0.16 webserver as target and always got the response 505 (unsupported http protocol version). Turned out the culprit was the extra space in
    “HTTP/1.0 \r\n”.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>