PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
eshban
Forum Contributor
Posts: 184 Joined: Mon Sep 05, 2005 1:38 am
Post
by eshban » Sun Nov 22, 2009 7:59 am
Hi,
I need to send js value to php, but i am having some problem in it.
here is my website url
Code: Select all
http://www.shehzads.com/Projects/flu/try.html
Just change quantity and you will see updated price.
I want that when user click on checkout button then i need the values of "Quantity" and Price at my php page.
please help
thnaks
BlaineSch
Forum Commoner
Posts: 28 Joined: Sun Jun 07, 2009 4:28 pm
Location: Trapped in my own little world.
Post
by BlaineSch » Sun Nov 22, 2009 9:05 am
Don't put the final price in the GET that can be too easily modified just put quantity. Either update the link or update a hidden input field.
Just update your "updatePrice()" function in your script.
Code: Select all
<script>
function updatePrice() {
var userInput = document.getElementById('price').value;
document.getElementById('q1q1').value=userInput;
}
</script>
<input type="hidden" name="quantity" value="0" id="q1q1">