For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > January 2008 > problem with sending json encoded data to php via ajax









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem with sending json encoded data to php via ajax
Pugi!

2008-01-09, 8:00 am

I am using AJAX (the YUI connection manager) to send the input from a
form (all fields added to an object called data and the json encoded)
to a php script. The charset for the webpage (valid XHTML), in the
php.ini and httpd.conf (and mysql db) is utf-8.
The php script is unable to json_decode the data when there is a =B0
present (symbol for degrees) when send by IE7 (still ok for FF, Safari
and Opera), the script is unable to json_decode the data when an & is
send by all the browsers.
I think the solution might be to use the escape function in javascript
and urldecode function in php, but I can't get it to work. The php
urldecode function is not the exact opposite of the javascript escape
function. Do you use escape and decode on the data, the query string
or the entire url ?

Pugi!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com