XML and PHP on Forms (passing data)?

Discussion in 'PHP' started by tdd1984, Apr 8, 2010.

  1. #1
    Yes we are passing data into a third-party site using an https GET. Well this HTTP URL code will return a XML code with, 1 on complete or 2 on failure. How can we make this go on in the background. Upon it completing we will redirect them into a Thank You page on our site?

    I'm thinking we should just have our form URL set to a page on our site. On that page, we will have a header function with the third-party URL on there. This is where I'm confused at because upon it doing that it will return an XML code (like mentioned above) at the same time redirecting into the third-party site. We want them to redirect upon a successful XML return into our Thank You Page?

    Can someone give me some guidance on this?
     
    tdd1984, Apr 8, 2010 IP
  2. thecancerus

    thecancerus Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use AJAX to submit the form and check the returned data and then redirect the user to your thank you form using 'window . location' in js
     
    thecancerus, Apr 8, 2010 IP
  3. tdd1984

    tdd1984 Well-Known Member

    Messages:
    2,357
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Ain't there a better way to do it through PHP?
     
    tdd1984, Apr 8, 2010 IP
  4. thecancerus

    thecancerus Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well you can use php curl functions to get the xml response and then using header function redirect.. check http://www.php.net/manual/en/function.curl-exec.php
     
    thecancerus, Apr 8, 2010 IP
  5. tdd1984

    tdd1984 Well-Known Member

    Messages:
    2,357
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    150
    #5
    Yea I'm more familiar with the CURL function.
     
    tdd1984, Apr 9, 2010 IP