I’m trying to integrate Paypal with eForm, and having trouble with my headers...
The basic scenario is that i have a form, using eForm of course, and once it is validated, i use the ’eFormOnBeforeMailSent’ parameter to send it a function name that will handle the submission to paypal.
The way this works is by creating some headers to redirect to the paypal site, along with POST vars.
The trouble is, my form gets all the way to the part where the headers are sent, but it never redirects (as far as i can see) - it ends up back at my homepage (though the address bar still shows that of the page where eForm is called)
Is it a problem calling ’header’ command in the middle of eForm processing?
Any help appreciated.
header("POST ".$paypal_path." HTTP/1.1\r\n" );
header("Host: ".$paypal_host."\r\n" );
header("Connection: close\r\n" );
header("Content-type: application/x-www-form-urlencoded\r\n" );
header("Content-length: " . strlen($data) . "\r\n" );
header("\r\n");
header($data);
exit();