How to simulate excel functions on website?

Can anyone make a recommendation how I would create the ability to do price calculations on a website, preferably in PHP script.

I have built out an excel matrix for my pricing that is based on variable lookups and then multiply that number by the quantity. My pricing is dependent on quantity price breaks (ex. 1-47, 48-71,72-143) and the number of inks used in the final product.

How would I simulate that concept on a website. Allow the user to input 2 variables and populate a price dependent on the how I described my spreadsheet.

I am clueless where to begin this process or how to look for help. How does one built something like this on a website?

Well, are you planning on putting this onto a public site? And, were you planning on putting this into a dabase?

If so, I suggest placing this info into tables inside a database. It would be very easy to do and many members will help you do this. Just ask further.

If not, and you just want to play with a page that has all of the data inside the page, you can do it with arrays instead of tables. Basically, load an array with all your data and use that for displaying.

Note that price breaks (ex. 1-47, 48-71,72-143), are very easy to do inside of a database. You would just create a table, let’s call it “Prices”. In that you would have fields, let’s call then something like this:
ProductiID, ProductName, Price1, Price48, Price72…
The prices would have to be entered into the table for all products.
This data might look like this: (Just a wild sample as you didn’t mention your product…)
1, “Large Red”, $5.00, $4.58, $3.99
2, “Small green”, $5.00, $4.44, $2.99
3, “etc… etc…”, $… You get the idea…

Then, when the user selects #2, Small green detailed item with light green trim, or whatever…
You would then do a query to select those prices (“SELECT * from Prices where ProductID=‘2’”)
and then display the prices from the row of data you receive back from the query. That would be
very simple to display. You could either show the entire row of prices with the current selection
highlighted so they may wish to order more to get a better break or you could just display the
actual price value.

Since you gave us little info about the business all of this is based loosely on general themes.
Hope it helps and ask away if you further questions… Good luck…

Yes, that is what my mind was beginning to figure out was the best way to approach this. I really had no clue and I am working in Dreamweaver but learning alot about PHP now. I need to get my database skills up to par. Thank you for confirming the direction I decided to go in. I am going to build out the tables and play with it.

I might gladly take you up on your offer for further questions. I am going to cross my fingers. Thank you very much for your reply.

No problem, that is why we are here…

During your layout of the database, make sure you think of every detail you may need. Much easier to write the code once the database is completed. And, as always, Google is your buddy, Google is your friend!!!
Note: Searching google for help, use this format: “PHP database read” or “PHP form variable” whatever, the important part would be starting the search with PHP. It will drop you on more useful sites than if you use “how to read a database in PHP”… You get the idea… Good luck…

Sponsor our Newsletter | Privacy Policy | Terms of Service