Hello All,
I am fairly new to PHP and have to use it for a project am on right now. What I have to do is send information to a payment form through POST headers. I cannot use a form submit because I have to make decisions on the information given and fill in the fields to be sent appropriately. I tried cURL, but I couldn't seem to get it to actually transfer to the site, http_redirect didn't seem to work for some reason, and I don't want to just append the string onto the url. I am going to try to fill in the fields and submit the form on Page Load through Javascript, but was hoping to stay away from Javascript (for that small percentage of folks who have it turned off). Has anybody had experience with this? And, if so, how did you go about it?
Thank You,
NUZZI
Post with Redirect...
Moderator: General Moderators
Re: Post with Redirect...
Man, the cURL option is so close. It does everything right on except actually transfer to that site. Is it an option I am leaving out?
Thanks,
NUZZI
Thanks,
NUZZI
Re: Post with Redirect...
cURL is your friend. What does your code look like?
Re: Post with Redirect...
Hello,
Thanks for the reply. The code looked something like below. Of course, I tried about 20 different varieties of different options, but this was the one I thought would work.
NUZZI
Thanks for the reply. The code looked something like below. Of course, I tried about 20 different varieties of different options, but this was the one I thought would work.
Code: Select all
<?php
$ch = curl_init();
// Actual Values Omitted for Privacy
$str = "postvar1=value1&postvar2=value2&postvar3=value3";
curl_setopt($ch, CURLOPT_URL,"https://secure.bluefingateway.com/gw/native/interactive2.2" );
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str );
curl_exec ($ch);
curl_close ($ch);
?>
Re: Post with Redirect...
Play around with some of the CURLOPT_SSL* options. Like the two VERIFY ones. Might need a certificate to connect to them or something, don't know.