valyent Posted August 24, 2011 Share Posted August 24, 2011 I have a form collecting registration data, on submit, I have a confirmation page displaying data via php (session var), followed by a form with a "confirmed" checkbox. On submit, if confirmed, I want two actions: to post the data to MySQL and open a new window with PayPal interface to accept credit card payment. Elementary but logic eludes.Is the location function only way to redirect? How do I format a location redirect with multiple input data?I see redirect is tricky. What page structure and php method would be best to get this done? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 24, 2011 Share Posted August 24, 2011 One way is to use Javascript to see if the checkbox is checked and open the new window before the form submits, then the form submits to go to the database and you display a thank you page or whatever. You can also have the form processor output Javascript code to open a new window. A location header is only used for a redirect, the only thing you send with a location header is the URL to redirect to. You can't tell the browser to open a new window with a location header. Link to comment Share on other sites More sharing options...
valyent Posted August 25, 2011 Author Share Posted August 25, 2011 Can I reverse that? Can I have javascript look at the checkbox and, if true, direct php to post variables to database and echo confirm, this happening on same page? Then on "submit payment" the form redirects to the PayPal interface in _blank window? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 25, 2011 Share Posted August 25, 2011 You can use ajax if you want to send requests to the server without reloading the page. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.