Saving a posted data before redirecting to 3rd party server

Discussion in 'PHP' started by samyak, Nov 18, 2013.

  1. #1
    I am trying to save the data that user submits from a form in my database before I post it over to the 3rd party website. How can I do this without using javascript?
     
    samyak, Nov 18, 2013 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    How are you posting the data to the third party site? Can you share some code?
     
    nico_swd, Nov 18, 2013 IP
  3. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #3
    well, its a simple HTML form with user's name, phone and email address. I need to post this over to the 3rd party website. BUT I want to validate the data that users enter before I actually send this data to the 3rd party. So i am doing HTTP post to my own page and if it validates, I need to somehow post this data (to the 3rd part) again. How do I do this?
     
    samyak, Nov 18, 2013 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    nico_swd, Nov 18, 2013 IP
  5. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #5
    yeah I can use CURL, but I need the browser to actually go to that 3rd party website after posting. Curl will call that page, but not redirect the browser to that page.
     
    samyak, Nov 18, 2013 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    Then output a new (hidden) form that contains hidden fields with the data, and automatically submit it to the other site using Javascript.

    It's not a pretty solution, but can't think of anything else right now.
     
    nico_swd, Nov 18, 2013 IP