Ciao e grazie della tempestiva risposta ma non ho capito una cosa.
Io devo mettere quello che mi hai scritto tu?
Io ho provato come hai scritto ma mi restituisce sempre uno, il motivo puo essere che esegue lo script tramite jquery cosi?
Codice PHP:
function aggiungi_prodotto(id, nome, prezzo){
var quantita=$('#quantita'+id).val();
$.ajax({
type: "POST",
url: "php/aggiungiAlCarrello.php",
data: "id="+id+"&nome="+nome+"&prezzo="+prezzo+"&quantita="+quantita,
dataType: "html",
success: function(msg)
{
$("#carrello").html(msg);
},
error: function()
{
$("").html("");
}
});
};