I’m POSTing the contents of a form field via AJAX to a PHP script and using this code
if(!http)
http = CreateObject();
nocache = Math.random();
http.open('post', 'addvm.php');
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = SaveReply;
http.send(params);
The problem is that any + and & signs are being stripped out and replaced. How can I safely ‘encode’ the + and & signs and then appropriately ‘decode’ it on the PHP side?
need to encode your params
encodeURIComponentNote:-When you access
$_GET, $_POST or $_REQUEST in PHP, you are retrieving values that have already been decoded.