session_start();
if(isset($_REQUEST['action']) && $_REQUEST['action']!="")
if ($action == "addToBasket")
{
$rmrradio1 = 3;
$rmrradio2 = 5.5;
$rmrradio2 = 16;
}
$(document).ready(function() {
$("input[type='radio']").click(function() {
var price = $(this).attr("value");
var name = $(this).attr("name");
add_payment_value(price,name);
});
});
function add_payment_value(price) {
// here you can use $.ajax function to add your 'price value' to your cart
$.ajax({
type: "POST",
url: "make-payment.php"// file where you can add price to your database
data: "rmr"=+price+" &action=addtobasket ",
success: function(){} // return something on success
});
}
I have written the code like this. This is for a shopping cart site. The above value just added with basket (add my cart) when click the radio button and also i want to know about the jquery I don’t know either this code is correct or not. But i need some one help to implement my project. Can any one give me a right code. Sorry if my q sounds unclear.
Write:
You get the vars in the
make-payment.phplike this: