I have searched and searched and tried many things but can not get this working correctly for some reason. I'm sure I am overlooking something simple. I appreciate your help in advance.
I have an order page with 3 forms on it and each has 3 submit buttons for checkout buttons to paypal, googlecheckout and direct debit/credit card.
On the first form I can check for which image/submit button was clicked and it performs the correct action with no problem at all. However, on the second and third form it isn't working at all for some reason and I have been killing myself trying to figure out why.
Here is the first form:
<FORM name="elp_ear_combo" id="elp_ear_combo" action="checkout.php" method="post">
<input name="PHPSESSID" value="<?php echo session_id(); ?>" type="hidden">
<input name="x_Description" value="ELP/EAR Combo ($99/mth)" type="hidden">
<input name="x_Amount" value="99.90" type="hidden">
<input name="x_Amount_monthly" value="99.90" type="hidden">
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_combo_paypal" value="Submit" type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Checkout With Paypal">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_combo_googlecheckout" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/google-checkout.png" alt="Checkout Using Google Checkout">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_combo_direct" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/checkout1.gif" alt="Checkout Using Credit/Debit Card Directly With Us">
</span>
</form>
Here is the second form:
<FORM name="elp_ear_pro_combo" id="elp_ear_pro_combo" action="checkout.php" method="post">
<input name="PHPSESSID" value="<?php echo session_id(); ?>" type="hidden">
<input name="x_Description" value="ELP/EAR/PRO Combo" type="hidden">
<input name="x_Amount" value="129.95" type="hidden">
<input name="x_Amount_monthly" value="129.95" type="hidden">
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_pro_combo_paypal" value="Submit" type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Checkout With Paypal">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_pro_combo_googlecheckout" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/google-checkout.png" alt="Checkout Using Google Checkout">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="elp_ear_pro_combo_direct" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/checkout1.gif" alt="Checkout Using Credit/Debit Card Directly With Us">
</span>
</form>
And the third:
<FORM name="leads_only" id="leads_only" action="checkout.php" method="post">
<input name="PHPSESSID" value="<?php echo session_id(); ?>" type="hidden">
<input name="x_Description" value="ELP Only" type="hidden">
<input name="x_Amount" value="49.95" type="hidden">
<input name="x_Amount_monthly" value="49.95" type="hidden">
<span style="padding:0px 10px 0px 10px;">
<input name="leads_only_paypal" value="Submit" type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Checkout With Paypal">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="leads_only_googlecheckout" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/google-checkout.png" alt="Checkout Using Google Checkout">
</span>
<span style="padding:0px 10px 0px 10px;">
<input name="leads_only_direct" value="Submit" type="image" src="https://www.extremeleadprogram.com/images/checkout1.gif" alt="Checkout Using Credit/Debit Card Directly With Us">
</span>
</form>
On the checkout.php file I have tried many things to detect say if either of the 3 paypal submit buttons were clicked and the 1st one works great, the 2nd and 3rd do NOT. Here's code I created just to debug why and it seems like it should work:
// Selected paypal
IF ( $_POST['elp_ear_pro_combo_paypal_x'] ) {
echo 'paypal selected 2';
exit();}
IF ( isset($_POST['leads_only_paypal_x']) ) {
echo 'paypal selected 3';
exit();}
IF (isset($_POST['elp_ear_combo_paypal_x']) ) {
echo 'paypal selected 1';
exit();}
//debug
while ($var = each($_POST) ) {
printf ("Key <b>%s</b> has the value of: <b>%s</b><br>", $var['key'], $var['value']);
}
exit();
But instead of ever getting to 2 or 3 when you click those two it simply gets to the debug code and runs it. Even when it does run it it shows that the correct thing is set, like if I click on the second paypal submit form, it goes past the code and shows all the post forms and will show:
Key PHPSESSID has the value of: cf1tevubmjiiqf8alht0vkp6a4
Key x_Description has the value of: ELP/EAR/PRO Combo
Key x_Amount has the value of: 129.95
Key x_Amount_monthly has the value of: 129.95
Key elp_ear_pro_combo_paypal_x has the value of: 80
Key elp_ear_pro_combo_paypal_y has the value of: 14
Key elp_ear_pro_combo_paypal has the value of: Submit
So if "Key elp_ear_pro_combo_paypal_x has the value of: 80" then it isset and should trigger that if right? But it doesn't.....
Can anyone point me in the right direction, I am GOING CRAZY here, thanks!