473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

php derived total

22
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 ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="hidden" name="amount" value="<?php if(isset($_GET['tc'])) echo ($_GET['tc'] + 25.99 + rTXSTax) ; ?>">
  3.  
  4.  
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
Dec 8 '07 #1
1 1410
clai83
41
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 ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="hidden" name="amount" value="<?php if(isset($_GET['tc'])) echo ($_GET['tc'] + 25.99 + rTXSTax) ; ?>">
  3.  
  4.  
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.
Dec 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christian Engström | last post by:
When I compile the below program with Microsoft Visual C++ version 6, I get the results I expect, which is that the program should write out base() derived() base() derived(derived) When I...
7
by: Christian Engström | last post by:
When i compile the program listed below with gcc version 3.3.1 (MinGW on Windows XP) I get the following result: Calling 'func(d)': 'base' copy constructor Calling 'func(*d_handle)': 'base'...
3
by: hazz | last post by:
The following classes follow from the base class ' A ' down to the derived class ' D ' at the bottom of the inheritance chain. I am calling the class at the bottom, "public class D" from a client...
2
by: John B | last post by:
Hello I want to create a set of controls that have some common methods and properties. I was thinking that I should subclass the UserControl class and add these common features there and then...
9
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't...
6
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
1
by: rbg | last post by:
I am using derived tables to Page data on the SQL Server side. I used this link as my mentor for doing paging on the SQL Serverhttp://msdn2.microsoft.com/en-us/library/ms979197.aspx I wanted to...
8
by: rbg | last post by:
I did use query plans to find out more. ( Please see the thread BELOW) I have a question on this, if someone can help me with that it will be great. In my SQL query that selects data from table,...
1
by: RoseM | last post by:
Hi again, I could use some help and have not been able to come to grips with what I need to do to make this work. I have a table of theories and votes and I want to return the percent to total...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.