I have a array student. I need to pass this array in another php page via POST, not from GET, because it can contains thousands of characters.
I am trying to open new page sheet.php and echo the array student, I do simply checking echo $_POST['mnu'], but it is showing undefined index error.
var http = null;
if(window.XMLHttpRequest){
http = new XMLHttpRequest();
}
else{
http = new ActiveXObject('Microsoft.XMLHTTP');
}
http.open('POST','sheet.php',true);
http.setRequestHeader('Content-type','application/x-www-form-urlencoded');
http.onreadystatechange = function(){
if(http.readyState==4 && http.status==200){
window.open('sheet.php','_blank')
}
}
http.send('mnu='+JSON.stringify(student));

sheet.php- a POST request and then, when that succeeds, a GET request?$.post('sheet.php',{mnu:student},function() {window.open('sheet.php','_blank')});$.post, it redirects but same problemundefined index $_POST['mnu']. Is there any other way to access ?? I am doing simplyif(isset($_POST['mnu'])){echo $_POST['mnu'];}sheet.phpand this time there is no data posted