Okay prior to my previous question I have tried a bit of modification to my code but somehow I am still lagging.
This is jquery I have created
$(document).ready(function()
{
var array_ids = [];
$('.add').click(function()
{
array_ids.push($(this).parent().siblings('.row_id').html().trim());
alert(array_ids);
});
$('.show').click(function(e)
{
//e.preventDefault();
var jsonString = JSON.stringify(array_ids);
$.ajax(
{
method: 'POST',
url: 'addsale.php',
data: {data : jsonString},
cache: false,
dataType: "json",
success: function()
{
console.log(data.reply);
alert(data.reply);
}
});
});
});
And addsale.php
if(isset($_POST['push'])) //tried it commenting also!
{
$data = array();
$data = json_decode(stripslashes($_POST['data']));
foreach($data as $d){
echo $d;
}
}
Can anyone tell me what is missing to access the array and get the html from addsale.php to current page?