Accepting a XML Post in PHP

Discussion in 'PHP' started by kevin7654, Oct 4, 2006.

  1. #1
    Hello,

    Does anyone have a sample script or know how to accept and parse an xml script in PHP? A remote server is going to post an xml response and I need to make a php script to handel it. Any help would be great.

    Thanks,
    Kevin
     
    kevin7654, Oct 4, 2006 IP
  2. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #2
    wmtips, Oct 5, 2006 IP
  3. kevin7654

    kevin7654 Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the link - very good advice.

    my main question is how to tell my php script to look for another script to post an xml file to it, and I could not seem to find that answer in the resources you mentioned in the other thread
     
    kevin7654, Oct 5, 2006 IP
  4. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #4
    I don't understand your question then. What do you mean by posting an xml to another script? You need to submit a form with POST method or what? Give an example.
     
    wmtips, Oct 5, 2006 IP
  5. kevin7654

    kevin7654 Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry for my lack of an explanation - my shipping company posts an xml form to my webserver any time a product is shipped. So, I do not know how to tell my script to look for this post.
     
    kevin7654, Oct 5, 2006 IP
  6. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm not sure what you mean.

    Look for what?

    Once the form data is posted, it is at the mercy of the webserver, so where does it get stored, if at all? Or are you parsing the form body?
    Give us a bit more information to work with.

    Also, you can use the DOMDocument class in PHP 5 to work with XML using the DOM API, if you are at all familiar with that.
     
    penagate, Oct 5, 2006 IP
  7. kevin7654

    kevin7654 Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks for your responses, I'm sorry I've done such a poor job of explaining the situation. I will look into the DOMDocument class you mentioned and see if I can get this script working. So I guess having a site post an XML file is very similar to a site posting a POST form?
     
    kevin7654, Oct 6, 2006 IP