We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6038
    • 228 Posts
    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();
    

      • 12320
      • 88 Posts
      on my remenber
      all header command in php must be sent before any caractere on a generated page...
        Thanks to the authors of the following code :
        Easy Newsletter (module)
        SiteMap (snippet)
        Codepress (Plugins)
        Strict URLs (Plugins)
        Virtual Aliases (Plugins)
        Maxygallery (snippet)