Accessing PHP array as json data for datatables from the another page

Accessing PHP array as json data for datatables from the another page

SatyaAchantaSatyaAchanta Posts: 22Questions: 3Answers: 0

Hello Everyone, I am Satya, I have two pages where page 1 sends parameters a,b,c to page 2 using $.POST in Ajax, now in page 2 it reads the values such as $_POST['a'],$_POST['b'],$_POST['c'] anow the issue rises, when I stored the retrieved data in local array and accessing it from page 1 through ajax:'page2.php' in console it shows a,b,c is not defined in page2.php, for clear reference I have included my code here, please have a look at that

Jquery:

$.post('page2.php',{a:'Satya',b:'20110101',c:'20131231'},function(data){
alert(data);
});

PHP:

$user=$_POST['a'];
$from=$_POST['b'];
$to-$_POST['c'];

echo json_encode($user);

now it gets the json_enocded data to the other page but in network tab in console it shows that http://--------//page2.php?=124354567897 and in its response it shows a,b,c are undefined, can any suggest me what to do, this is the first time I am facing this kinda problem

This discussion has been closed.