473,800 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php derived total

22 New Member
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 1423
clai83
41 New Member
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
1987
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 try to compile it with gcc, I instead get the compiler error message
7
1630
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' copy constructor Calling 'func(d_handle)':
3
1599
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 app with; D m_D = new D(tkn); public class A : MarshalByRefObject public A () <--------------------- public class B : A public B () <----------------------
2
2098
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 base all my custom controls on this new MyUserControl Class. Is this the way to go? The MyUserControl would not actually have any UI component and should be abstract I think. Does this mena that I should not create the control by just selecting...
9
1807
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 figure out what attribute to put on the base class method to prevent this. TIA, Larry Woods
6
2501
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
4148
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 use USER PAGING, thus I used the following code: CREATE PROCEDURE UserPaging ( @currentPage int = 1, @pageSize int =1000 ) AS
8
2807
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, I have a where clause which states : where PermitID like @WorkType order by WorkStart DESC
1
1569
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 of 'yes' votes. Here's what I have so far, which doesn't work: SELECT Count(tentries.vote) AS CountOfvote,count(tentries.theory) as countoftheory FROM tentries GROUP BY tEntries.vote, tentries.theory ORDER BY tEntries.vote,tentries.theory;
0
9694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9553
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10509
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10256
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7584
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.