PHP: Send form data to php script which then posts data to another script/site?

I use a 3rd party form processor. The issue is, I need a way to redirect the user after submitting data to the 3rd party form processor. The 3rd party processor is and I am using to troubleshoot my post submissions.

I was thinking of:

  1. Client submits form
  2. My php form-processor captures the data
  3. My php form-processor then Submits the data via POST or GET to the 3rd party form processor
  4. My php form-processor then redirects the user to a thank you page.

I might be over thinking this, but the only way I see of doing this is making a form that posts data that has been posted to it. Otherwise the form will just send my user to the 3rd party processor without redirecting them to whatever page I choose. The 3rd party form processor doesn’t have a way of me using custom redirects.


I would consider using AJAX for this:

  1. user fills in info and submits.
  2. post is passed to AJAX function ( jQuery ) which posts data to your form processor.
  3. on the success handler of the AJAX, process the codes and inject a thank you into the DOM using jQuery.

This approach does not load a new page and no redirects occur. It also ensures that the form cannot be double submitted.