I am now on a php page that has presented the user with some choices and I have saved the users input in 5 javascript variables:
product_format
product_print
product_paper_weight
product_paper_type
product_quantity
I want to send them to a a calculate.php page that will do the calculation of the price and then include calculate.php on my page and present the user with the price dynamically. I have read send javaScript variable to php variable that I can use:
window.location.href = "calculate.php?name=" + javascriptVariable (and the rest);
And then I could use php get to calculate by querying the database. I also need this to be done continously as soon as the user changes an option I need to recalculate the price and present a new price.
Is this possible? Is there a better approach? Am I thinking right? Should I instead calculate the price by loading the php-sql data into javascript and calculate in javascript instead? Which is quicker and more secure?