jrobles Posted December 29, 2009 Share Posted December 29, 2009 I am trying to insert the form data before I post the form to the linkpoint site. I tried making the action="" then set the header location to the linkpoint site after the data is entered into the but i get headers already sent errors. if (!isset($_POST['Submit'])) {echo" <form action='' method='post'> blah blah blah </form>";} else {INSERT blah into blah; header("Location: www.linkpointcentral.com/blah/blah ") } How can I insert into my db before the form is posted to the linkpoint url? Quote Link to comment https://forums.phpfreaks.com/topic/186544-linkpoint-cc-processing-help/ Share on other sites More sharing options...
oni-kun Posted December 29, 2009 Share Posted December 29, 2009 You're not supposed to output ANY data before sending another header. Make sure there is no echo statement or whitespace before the opening <?php tag. If you must use the header after outputting data to the browser, than put this at the top of your code, ob_start <?php ob_start(); //Start output buffer This will fix the headers already sent error, but should be seen as a bandaid rather than a solution. Quote Link to comment https://forums.phpfreaks.com/topic/186544-linkpoint-cc-processing-help/#findComment-985186 Share on other sites More sharing options...
jrobles Posted December 29, 2009 Author Share Posted December 29, 2009 Thanks for the help, I figured out a work-around that happy with. The form action is set to "". When the user submits the form the data is entered then a confirmation shows where the user can doublecheck their info then hit submit. The second form sends the data to the payment gateway. Quote Link to comment https://forums.phpfreaks.com/topic/186544-linkpoint-cc-processing-help/#findComment-985225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.