So I have some form validation on this project of mine that works like this (totally pseudo-code here): <head> <?php function show_form() { ?> <form name="form" action="" method="POST"> // Form fields here. <input type="submit" name="submit" /> </form> <?php } function check_form() { if something is invalid { flag = true; } if (!flag) { // Do stuff with form data. } else { // Show error and call form again. } } ?> </head> <body> <?php if (isset($_POST['submit'])) { check_form(); } else { show_form(); } ?> </body> PHP: ...and that works fine. But now I want to add PayPal to the site so that when the form is submitted, it runs the validation, and, if everything's ok, it sends the user to PayPal where payment is made. The problem is, in order to do that I have to give the form an action (action="https://www.paypal.com/cgi-bin/webscr"). But if I do that, then I lose my form validation. How can I have my form validation and PayPal button?
In case anyone else has the same problem, my solution was to send the user to a confirmation page (with the PayPal Buy It Now button on it) if the form validates. Maybe a lazy way to take care of it, but it works.