Javascript var with specialchars with AJAX to $_GET in php

Loupblanc

New Member
I have a text form with CKEditor:\[code\]<textarea id="descrizione_it"></textarea><textarea id="descrizione_fr"></textarea>... many others inputs ... <button onclick="addDataProd()">\[/code\]The JS Function:\[code\]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();}\[/code\]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\[code\]alert(descrizione_fr)\[/code\]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:\[code\]alert(descrizione_fr)\[/code\]results in:\[code\]test_test_&egrave;test\[/code\]PHP:\[code\]echo $_GET['descrizione_fr_new'];\[/code\]results in:\[code\]test_test_\[/code\]How can I solve that?Thank you!
 
Top