Jump to content

How is this done using PHP?


einstein101

Recommended Posts

Hi.  I need to know how to develop a similar page like the one below.  If you click on a different item and put the sizes in, it puts the price in automatically. 

 

How is this done using php? 

Do they use a database? 

Something other than php on the front end? 

Can anyone give me an example of how it would be done?

 

http://www.customfilters.grainger.com/index.php/fgCatalog/main/set=HVACPL40STC

 

Thanks in advance for your help.  I'm really confused as to how this would be done. 

 

 

Link to comment
https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/
Share on other sites

Most likely they take the total area of the filter (WxL), along with a modifier for the thickness, and compute the price that way.  So, if the total area is 100 in^2 (10 in x 10 in), with a thickness of 2 inches, and the standard price for a 2 inch thick filter is 25 cents per square inch, the final price would be .25 * 100 = $25.

 

Although there are a lot of different ways...maybe they have a general price for size ranges.  Maybe they have some fat guy on the other end that sees the request and makes up a number.

Yes.  It looks like when you click on a filter it loads a different page.  So, they probably send the information to the server to calculate.  I am getting the picture now.  But, the values are probably not in a database then.  

 

Example:

Filter 1 page has, as the previous post suggested a set multiplier.  

 

$filter1 = .25 and if you plug in 10 x 10 you multiply by the factor and place the value into the price.  Does that make sense?  

 

It seems that if it used a database would it load a new page for each filter? 

Why would you think it isn't in a database? I would rather have pricing information in a database with an administration opage where it can be easily editied as opposed to having it hard-coded in a server-side file. The fact that the info is or is not in a database has nothing to do with whether or not a new page is loaded.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.