This is driving me crazy!
I have something like this in JS:
xmlhttp.open("POST", "/note.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
console.log(" >>>> " + note + " " + noteHTML);
xmlhttp.send("what=edit¬e=" + note + "¬eHTML=" + noteHTML + "¬eIdx=" + noteIdx);
Output in console:
>>>> C++ C++
This code sends most of the text correctly through, aka in note.php
I get the same content than the content on the JS side, but for whatever reasons it does something very strange to the string C++
. When note
or noteHTML
which are strings are set to C++
then what arrives on the PHP side (in note.php
) is C
and not C++
!! This doesn't make ANY sense to me. Maybe there is something wrong with the encoding I chose. I tried html
and plain/text
but for whatever reason I don't even get anything at all on the php side so I gave up with looking into this direction any further. Any idea why?
else if ($_POST['what'] == "edit")
{
printArray($_POST);
}
Output in browser:
what => edit note => C noteHTML => C noteIdx => 17no
WHY?