as a novice I can't get this one figured out and would appreciate any advice or help you could offer.
am trying to pass a php derived total to a html form that passes the info to paypal. our form variable with the php looks like this ...
-
-
<input type="hidden" name="amount" value="<?php if(isset($_GET['tc'])) echo ($_GET['tc'] + 25.99 + rTXSTax) ; ?>">
-
-
this works fine with one small problem - that is really hugh. we're running a php routine that generates the order form and allows the user to update quantities for the items they have selected. the value above is generated when the page is produced and if the user makes any changes the amount value is NOT updated when it is passed to paypal.
have tried POST GET and EXPLODE but cant get any of them to work. maybe we could define a variable that would recalculate the value when the form is SUBMIT ed to paypal?????????
please help ... thanks
Hopefully I'm understanding this right, but if I'm not please let me know.
You have a form that basically has a list of items (a picture would be nice) and a total on the bottom. When this page is generated it it computes a total of some sort.
You problem is if the user changes any values before submitting it the total isn't updated.
As a friendly reminder PHP is a server-side script. Any changes the user makes after the page is generated will not be updated unless you write a script to accomodate that. If you want to dynamically change values while the user is changing things on the form, I suggest javascript.
I have no idea how this system looks like but here is a possible solution in PHP.
A. Before you submit the form to paypal generate a confirmation page that will display the total. This way you have a chance to update all your values before it is submitted to paypal. If the user feels that everything is correct, the user can press the confirm button.