I'm developing a payment gateway with a Spanish bank and they want to recibe the payment request with a POST form. All the payment gateway developed I saw use the GET method for the submit. Are there some way to generate a form submit with a POST method with drupal or with PHP? Do you know some payment gateway submiting payment request with the POST method?

Best Regards.

Comments

anantagati’s picture

When you create form you can use:

<?php
$form['#method'] = 'post';
?>

You can look into Forms API Reference: http://api.drupal.org/api/4.7/file/developer/topics/forms_api_reference....

solanas’s picture

Let me explain better. I would like to generate a POST request to a external URL. My request should be generated in the php code without the clic of a user in the submit button.

I can do it preparing an html page with the form and with a JavaScript excecuted when the "onload" with something like:

document.forms[0].submit();

We can make a drupal_goto to redirect the user to other web page simulating a form submit with GET method. I would like to make something similar simulating the submit of a POST form.

Best regards.