Here is what I want to do:
I have some json like this
var foo = {
format:"json",
type:"test",
id:"26443"
};
and I awant to put that in a url like this
'http://example.com/a:3:{s:6:"format";s:4:"json";s:4:"type";s:4:"test";s:2:"id";s:5:"26443";}'
which I will then put into ajax call but everything I have tried results in error 501 BAD URI could someone tell me how to do this
I've tried this EDIT:
after looking again and alerting the results of this function it IS build the results correcty they just arrn't being used propler either by ajax or the browser
function js_array_to_php_array(a) {
var a_php = "";
var total = 3;
for (var key in a){
total;
a_php = a_php + "s:" + String(key).length + ":\"" + String(key) + "\";s:" + String(a[key]).length + ":\"" + String(a[key]) + "\";";
}
a_php = "a:" + total +":{" + a_php + "}";
return a_php;
}
when I use http fox it get this back
http://example.com/a:3:%7Bs:6:%22format%22;s:4:%22json%22;s:4:%22type%22;s:4:%test%22;s:2:%22id%22;s:5:%2226443%22;}
which i find odd because it ecodes everything but the last curly bracket