troubleshooting Question

functions and looping

Avatar of Refael
RefaelFlag for United States of America asked on
3 Comments1 Solution218 ViewsLast Modified:
In HTML table I have 7 different tours (sightseeing tours).
The table has 5 columns:

TOUR CODE: (examples below)
<input type="hidden" value="AEPN4" name="TourCode1">
<input type="hidden" value="AEPSP4" name="TourCode2">

TOUR NAME: (examples below)
<input type="hidden" value="Walking Guided Tour" name="TourName1">
<input type="hidden" value="Day Tour" name="TourName2">

PRICE: (examples below)
<input type="hidden" name="PriceWGT" value="15" onChange="calculate()">
<input type="hidden" name="PriceDT" value="54" onChange="calculate1()">

* The WGT for example is the initial tour name and the JavaScript doing the calculation of the Price and the number of tickets the user selects.

QUANTITY: (examples below)
 <select name="QuantityWGT" onChange="calculate()">
<select name="QuantityDT" onChange="calculate1()">

TOTAL: (examples below)
<input type="text" size="8" name="TotalWGT">
<input type="text" size="8" name="TotalDT">

In the PHP page, the page that gets the variables I used thefunction, “if ($TotalWGT >0)” that’s in order to know which tour/s the user selected. Since I do not know so good how to build functions I actually did it for all the 7 tours. When the function is “true” it echo the all the information from the HTML table for the user last review. (e.g. Tour Code, Tour Name and so on).


In the review information page (the PHP page) after the user review its selections he has to click on a button that connects to third party credit card billing via CGI script.  

One of their requirements is to send in ONE SUBMITTED variable the information as follow: Tour Code, Number of tickets, and Total for each tour the user has selected.
So basically it can contain all of the 7 tours.

The total sum of all the tours I already managed to do. But I do not know how to “loop” to check which tours are selected and how to combine all this information into one submitted variable.

Please if someone can help me!!!!!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros