I have a text form with CKEditor:
<textarea id="descrizione_it"></textarea>
<textarea id="descrizione_fr"></textarea>
... many others inputs ...
<button onclick="addDataProd()">
The JS Function:
function addDataProd(){
var descrizione_it = CKEDITOR.instances.descrizione_it.getData()
var descrizione_fr = CKEDITOR.instances.descrizione_fr.getData()
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
alert(xmlhttp.responseText);
}
}
xmlhttp.open("GET","prodotti_ajax.php?descrizione_it_new="+descrizione_it + "&descrizione_fr_new="+descrizione_fr,true);
xmlhttp.send();
}
And the PHP with get the data and updates the database.
Now if I wrote some special charaters on the CKEditor textarea, those charaters are always and immediatly converted tu htmlentities (è).
If I write on the JS
alert(descrizione_fr)
I get the string as written in CKEditor e.g.
èèèà
but when I echo the string in php the string stops just before the special charaters.
E.g. JS:
alert(descrizione_fr)
results in:
test_test_ètest
PHP:
echo $_GET['descrizione_fr_new'];
results in:
test_test_
How can I solve that?
Thank you!