Hello looking for a way to submit registration form data to db then redirect to Paypal to pay. I am creating a paid membership website with a monthly subscription. have the form created works fine, with out the payment button. it redirects to register?success.php which tells customers to check email. How ever with a Paypal subscription button add to page it either goes to success.php if i remove the Paypal link, but if i leave it in the form action spot it redirects to Paypal with out updating db. Any suggestions would help.

Hers a look at the register.php page.

<?php
if (isset ($_GET['success']) && empty($_GET['success']))
{
echo 'Thank you for registering,<br> to complete your registration please follow the link in your email.';
}
else
{

if (empty ($_POST) === false && empty ($errors) === true)
{
$register_data = array(
'username' => $_POST['username'],
'password' => $_POST['password'],
'user_firstname' => $_POST['user_firstname'],
'user_lastname' => $_POST['user_lastname'],
'user_email' => $_POST['user_email'],
'email_code' => md5($_POST['username'] + microtime())
);



register_user($register_data);
header ('Location: https://www.paypal.com/cgi-bin/webscr ');
exit();
}
else if (empty($errors ) === false)
{
echo output_errors($errors);
}

?>
<form name="_xclick" action="" method="post">
<ul>
<li>
Username*<br>
<input type="text" name="username">
</li>
<li>
Password*<br>
<input type="password" name="password">
</li>
<li>
Password Confirmation* <br>
<input type="password" name="password_confirmation">
</li>
<li>
First Name*<br>
<input type="text" name="user_firstname">
</li>
<li>
Last Name*<br>
<input type="text" name="user_lastname">
</li>
<li>
Email*<br>
<input type="text" name="user_email">
</li>
<li>

</li>



<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="item_name" value="RegFee">
<input type="hidden" name="business" value="myemail">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="10.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">


</ul>
</form>