Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2003, 04:13 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Quote Form using an Array - Help

Hi,

I am trying to create a instant online quote form to no avail. I have a look up table that in in a multidimensional array to find the cost of printing based on how many items are ordered and how many colors are going to be used. Everything seems to work, except the amount in the array (unitPrice) is not being pulled from the table (in fact nothing is being pulled from the table). Any help would be great. I have pasted the code below.


<% Response.buffer = true %>
<%
dim total
Dim colorPriceTable

colorPriceTable =Array(_
Array(1, 6, 12, 24, 48, 72, 144, 288, 500, 1000, 2001),_
Array(4, 2.5, 1.6, 1.15, 1.1, .9, .75, .65, .6, .55, .5),_
Array(7, 3.1, 2.45, 1.9, 1.5, 1.35, 1, .85, .8, .7, .65),_
Array(8.5, 4, 3, 2.85, 1.95, 1.65, 1.45, 1.3, 1, .85, .8),_
Array(10, 4.7, 3.6, 3.45, 2.3, 1.9, 1.7, 1.6, 1.3, 1, .85, .8),_
Array(12, 5.4, 4.25, 4.05, 2.75, 2.2, 1.95, 1.9, 1.5, 1.15, 1),_
Array(13, 6.3, 5.05, 4.75, 3.35, 2.7, 2.35, 2.2, 1.7, 1.3, 1.1)_
)

numC = request("numberOfColors")
qty = request("quantityOrdered")
qtyRow = colorPriceTable(0)
priceRow = colorPriceTable(numC)
style = request("style")

For col = 0 To UBound(qtyRow)
If qty < qtyRow(col) Then
unitPrice = priceRow(col)
Exit For
End If
Next

total = (((unitPrice * qty) + (style * qty) + (.25 * qty) + (numC * 22))* 1.54)

if style = 1.98 then
styletemp = "Beefy-T"
  elseif style = 1.99 then
   styletemp = "T-Shirt 1"
end if
%>

Thanks for You Help :)
 
Old July 8th, 2003, 04:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe you should post this to an ASP forum...?

Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Quote Form jbcobbs Beginning PHP 2 April 25th, 2006 06:02 PM
array form problem jun99 PHP How-To 4 December 1st, 2005 02:23 PM
putting an array unto a form Nyah Access VBA 1 January 14th, 2004 04:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.