Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 8th, 2003, 04:13 PM
Registered User
 
Join Date: Jul 2003
Location: Burnsville, MN, USA.
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 :)
Reply With Quote
  #2 (permalink)  
Old July 8th, 2003, 04:41 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
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/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.