How to send JSON object using JQUERY to PHP?

After struggling for hours and googling more, finally i succeeded in commincating over Json object. I will share the code:

JS side:

var datastring=JSON.stringify(obj);
$.post('getmessage.php',{data:datastring},function(res){
alert("HIIII"+res);
},"text");
});


php side:

$data=json_decode(stripslashes($_REQUEST['data']),true);
echo $data['page'];
?>

Popular posts from this blog

Watch Live cam on Google!!!!!

Why India Hasn’t Built Its GPT Moment (Yet)

8 Product Management lessons from the movie 'Gold'