eZ Community » Forums » Developer » ezRedirectGateway POST data issue
expandshrink

ezRedirectGateway POST data issue

ezRedirectGateway POST data issue

Monday 20 June 2011 9:57:11 am - 1 reply

Hello,

I'm trying to make a redirection of POST data to another site and then to redirect to the next page. So far, I've been experimenting with the cURL functions of PHP, with no luck. What I'm trying to do here is:

Take POSTed data from the Gateway => success,

Send POSTed data to another site => success,

Redirect to the site with the POSTed data => unsuccessful.

I get a kernel(20) error on my site because it tries to redirect me to /1, and not to my appointed site.

The code so far (in the eZRedirectGateway function createRedirectionUrl) is:

$ch = curl_init($server);
      curl_setopt( $ch, CURLOPT_POST, true );
      curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
      curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
      curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)" );
      curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
      $response=curl_exec($pg);
      curl_close($pg);
return $response; 

Any suggestions?

PS. I also tried to modify the header of the cURL, but to no avail.

PPS. And no, I can't use GET, the site of the payment only accepts POSTed data.

Modified on Monday 20 June 2011 9:58:28 am by Tomislav Buljević

Friday 24 June 2011 5:54:46 pm

Just make the curl request to post your data to the external site.

After this you can make a header redirect (like 'header('Location: http://xy.com')blunk.gif Emoticon ... Not nothing must be send to output before you make the header redirect.

I hope i understood your problem. Otherwise explain again.

Regards,
Martin

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from