Jump to content

Forward/redirect POST submissions via POST


awpeacock

Recommended Posts

I need to be able to forward on POST variables programmatically in PHP, via POST again.  The problem I have is thus:

1. "John Smith" buys some stuff from website X. He goes through checkout, and on the last page of checkout specifies that he is from the UK (as this will affect postage costs).

2. When Mr Smith clicks Submit, he is taken initially to PHP script myscript.php on website X that validates the data he entered on the previous form.

3. On successful validation, myscript.php redirects to https://www.creditcardcompany.com/makepayment, retaining all the information previously posted through (e.g. name => John Smith, country => UK, etc.)

This can be done via GET no problems -

header("Location: https://www.creditcardcompany.com/makepayment?name=John+Smith&country=UK...").

However, for obvious reasons (such as not wanting all variables to be plainly visible in the URL, and that the URL will be ridiculously large), I want to POST to the makepayment page. Is there a way to do that?

There is the Javascript auto-submit option on the gateway page but, again, this is not preferable as I don't think my client would like their customers to see such a page.

cURL and socket functions also aren't going to work because, obviously, punters want to see the nice padlock symbol and the letters "https" at the start of any URL when entering CC details.

Somebody PLEASE, PLEASE tell me this is possible.

Thanks
Link to comment
Share on other sites

Unfortunately, session isn't an option as the two scripts are on different servers.  The whole need for the redirect is because the CC handling stuff is on a third party server, otherwise the script doing the validation could handle everything else too.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.