possibly html form question

I am not sure how to make this sound really easy, but I will try.<br />
<br />
I have a course list on a php web page that you can click a button to register for. The page pulls information from an XML file. The problem I am having is this:<br />
<br />
1. I click on the button to register (I need this to open a php register form page target="_blank". (good so far and it works)<br />
2. ONCE you fill in the form and click submit, I need this to open paypal to accept payment (action="https://www.sandbox.paypal.com/cgi-bin/webscr" target=_blank).<br />
3. If paypal completes and is accepted then I would like the registerForm.php to submit the information from before BUT NOT before paypal is complete. If paypal is cancelled at any point then I want my registerForm.php to close and only the main webpage should be open (as if to start the whole process over again).<br />
<br />
My problem is how to get this to work.<br />
--mainpage (not sure if i should make this form a popup?)<br />
<form action="registerForm.php" target="_blank" method="post"><br />
<input type="hidden" name="item_name" value=" <?php echo $course_data[$a]["name"]; ?>" ><br />
<input name="submit" type="image" src=http://www.webdeveloper.com/forum/archive/index.php/"./pictures/register_now.png" alt="Make payments with PayPal - it's fast, free and secure!" border="0"><br />
<form><br />
<br />
--registerForm (here take all user data and plug into paypal BUT DO NOT SUBMIT UNTIL PAYPAL COMPLETED)<br />
<form name="RegisterForm" id="RegisterForm" method="post" enctype="multipart/form-data" action="https://www.sandbox.paypal.com/cgi-bin/webscr"><br />
<input type="hidden" name="recipient" value="[email protected]"><br />
<input type="hidden" name="subject" value="Web FormMail"><br />
<input type="hidden" name="gmt_offset" value="-5"><br />
<input type="hidden" name="cmd" value="_ext-enter"><br />
<input type="hidden" name="redirect_cmd" value="_xclick"><br />
<input type="hidden" name="first_name" value=" <?php echo $HTTP_POST_VARS["first_name"]; ?>" ><br />
<input type="hidden" name="last_name" value=" <?php echo $HTTP_POST_VARS["last_name"]; ?>" ><br />
<input type="hidden" name="address1" value=" <?php echo $HTTP_POST_VARS["address1"]; ?>" ><br />
<input type="hidden" name="address2" value=" <?php echo $HTTP_POST_VARS["address2"]; ?>" ><br />
<input type="hidden" name="city" value=" <?php echo $HTTP_POST_VARS["city"]; ?>" ><br />
<input type="hidden" name="zip" value=" <?php echo $HTTP_POST_VARS["zip"]; ?>" ><br />
<br />
So far the pattern works, but how do i get the registerForm.php to NOT submit but open paypal and once paypal is completed <br />
(i.e. <input type="hidden" name="return" value=""><br />
<input type="hidden" name="cancel_return" value=""> )<br />
have it close the paypal page, focus on the registerForm.php, and NOW submit that. If paypal is cancelled, then close both the paypal popup and the registerForm.php popup?<br />
<br />
Thanks for your help in advance!<br />
And I know that I did not give you ALL the inputs but rather just the main ideas.<br />
<br />
Anthony<!--content-->
 
Back
Top