I have quite an interesting issue. As you can see in the code below, I send 2 POST variables to my PHP page. One of the variables is a JSON array. If unsyncedContacts.length
is < 71, it works as intended. As soon as we get over 71 items in the array, the PHP page will only recognize the first 71. I've watched the timeline in chrome as this is happening and the data is under a MB.
Any advice or help would be greatly appreciated as I am at a loss. There are no errors being thrown, and the 71 records that do manage to be sent between the pages are executed properly.
JS
$.ajax({
url: 'ajax/upsert_contacts.php',
type: 'POST',
dataType: 'json',
data: {
"contacts": unsyncedContacts,//JSON array
"userInfo": localStorage.userInfo
}
})
.done(function(data) {
//do stuff here. i don't think its part of my issue
});
PHP - upsert_contacts.php
set_time_limit(0);//set the time limit for each contact to prevent breaking.
//POST DATA
$currentUsersName = json_decode($_POST['userInfo']['usersName']);
$contacts = $_POST['contacts'];
$aCount = count($contacts);//returns 71 at MOST
I've tried stepping through the PHP with xdebugger and $aCount always returned 71 at most. As I said before, if it were say 50 items in $contacts, it'd work great. Once it hits 72, it gets weird
Edit: Someone asked in the comments, but deleted it: "Whats your server's max_input_vars set to?".
max_input_vars 1000