This question already has an answer here:
I am using codeIgniter and my js code is in my view.. and i want to pass the value in my controller..
var storage =[];
function something()
{
storage.push('the value');
}
now i want a better way to pass the storage array into my php. Thanks in advance
this code is not working because it is in the seperate folder
$.ajax({
url: 'yourPHPFile.php',
type: 'POST',
data: {data:storage.toString()},
success: function(result) {
// handle your success
},
error: function() {
// alert("error");
}
});
"push storage array into my php"
. It's rather broad and vague. – Darren Jul 25 '14 at 6:09