I’m using Ajax to post contents, and I’m using http.send(encodeURIComponent(params)); for encoding … but I’m unable to decode them in PHP. I’m using POST so I didn’t think it required encode? I’m confused as to how I’m supposed to decode the values in PHP…
params = "guid="+szguid+"&username="+szusername+"&password="+szpassword+"&ip="+ip+"&name="+name+"&os="+os;
//alert(params);
document.body.style.cursor = 'wait';//change cursor to wait
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(encodeURIComponent(params));
encodeURIComponentwill encode all the &s and =s that delimit your key/value pairs. You need to use it on each part individually. Like so: