Here is my code:
$(function() {
$('#button-cart').on('click', function() {
$.ajax({
url: "shop/system/library/cart.php?csp=" + $('#input-custom-price').val(),
success: function(data) {
console.log($('#input-custom-price').val());
}
});
});
});
in case , when i send this variable, to my own php i can read the variable with GET:
$csp = $_GET['csp'];
This is working perfectly. But when i try to send to cart.php (which is an opencart file), i always get an error: "Notice: Undefined index: csp in ... on line 314" So i edited my code:
$csp = (isset($_GET['csp']) ? $_GET['csp'] : 10);
Now there isn't error message, but the php always calculate with 10. Any idea?