I'm using the following code to perform a POST-request:
function sendAjaxRequest(text) {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('results').innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open('POST', 'generate.php', true);
xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlhttp.send('code=' + text);
}
Where generate.php
looks like this:
<?php
echo isset($_POST['code']) ? $_POST['code'] : '';
The problem now is that if I send long texts they alway get cropped. I tried to increase post_max_size
in php.ini
but wasn't successful. Btw I'm using XAMPP.
I'd appreciate any guidance.