Hello,
I was wondering if you have to urlencode/urldecode a json string that would be sent/retrieved from the url (using $_GET).
![]()
| SitePoint Sponsor |

Hello,
I was wondering if you have to urlencode/urldecode a json string that would be sent/retrieved from the url (using $_GET).
![]()

It's a common practice to URL encode anything that is not an alphanumeric or numeric value been added to the URL as a query string, so yes i would recommend you do URL encode your JSON string.
Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
Having lame problems with your code? Let us help by using a jsFiddle

It's going to be very long... base_64 encode/decode would help, wouldn't it? Is it good practice?

If the JSON string is going to get longer then say 300 characters then i would recommend you use $_POST instead of $_GET as it's less overhead for the browser to process
Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
Having lame problems with your code? Let us help by using a jsFiddle

In my scenario, javascript has to read the JSON string too. No access to _POST.
Bookmarks