Mixing PHP with javascript?
Posted: Mon Jul 28, 2008 12:33 pm
I'm working on a ecommerce page for my employer. This is my first real experience with PHP, so I don't even know if this is going to be possible.
So here's my problem. After the customers select the product they want, it takes them to a page where it shows them what they purchased, with the price. Under that, my boss want them to be able to select a shipping option. Under that will be the total. What I'm looking to do is get the total to automatically update when the customer selects their delivery option. I know PHP is serverside, so I don't think that it will be able to do that for me. So I think I need to use javascript. Only problem is all my variables are in PHP. Is there any way around this? Or can I some how use PHP variable with javascript?
So here's my problem. After the customers select the product they want, it takes them to a page where it shows them what they purchased, with the price. Under that, my boss want them to be able to select a shipping option. Under that will be the total. What I'm looking to do is get the total to automatically update when the customer selects their delivery option. I know PHP is serverside, so I don't think that it will be able to do that for me. So I think I need to use javascript. Only problem is all my variables are in PHP. Is there any way around this? Or can I some how use PHP variable with javascript?