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?
Mixing PHP with javascript?
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Mixing PHP with javascript?
Generate javascript with the variables you need. PHP is a language to generate HTML, Javascript, CSS, images ... anything that can be used by the browser.
(#10850)
Re: Mixing PHP with javascript?
I'm not sure how I would go about that. Could you explain more, or do you know of an online tutorial that could explain more? I tried searching google for more info, but I didn't find anything, because I really don't know what I'm doing.