This has been happening since I migrated servers (upgraded to a dedicated server)
The AJAX calls, based on jQuery, were working fine for months (if not years) and suddenly they ALL stopped working, across all my accounts. You can imagine my panic.
The removefile function looks like this:
function removefile(filename,folder,targetdiv) { // universal AJAX file removal function. folder MUST include '/' at the beginning for calls.
$.post('ajax_removefile.php', {folder:folder, filename:filename },
function(data){
if(data=='1') {
$('#'+targetdiv).html(filename+' has been successfully removed.');
}
else if(data=='0') {
$('#'+targetdiv).html(filename+' is already removed - nothing more to remove.');
}
});
}
But for some reason, even though Firebug shows a successful registration of the POSt vars being sent, the php file returns completely empty POSt vars. print_r($_POST) or print_r($_REQUEST) returns empty arrays in both cases. If I change the method to a GET mechanism it works – but I’d like to keep it at a POST variable.
Oddly enough, the issue was due to a post_max_size that was set too high. Yes, too high. I had to drop it down to what’s written in the core php.ini file. I had it set to 20000M across different accounts to just make sure it’s practically unlimited, so I had to drop that to 128M (as per the core php.ini max) and it worked.