Hi, Thanks! That's not it, it's not case sensitive.

In fact the mistake was on the PHP. I solved it by strip the slashed
first to have a proper PHP array.

        $json1 = json_decode(stripslashes($_GET["json"]));

Someone please correct me if using the wrong path.

Thanks, Hannes





On Feb 23, 3:54 pm, Fábio Costa <[email protected]> wrote:
> Json should be JSON.
> so you should use...
>
> new Request.JSON()
>
> and
>
> JSON.encode()
>
> Fábio Miranda Costa
> Engenheiro de Computaçãohttp://meiocodigo.com
>
> On Sun, Feb 22, 2009 at 6:19 PM, h...@nnes 
> <[email protected]>wrote:
>
>
>
> > Hi there,
>
> > Sorry the post went of before finished! So this is my actual post:
> > I'm trying to send some json object to php and to get the very same
> > object back.
> > I envisioned that to be the absolute minimum configuration, but I
> > still can't get it to
> > work. Please point me to WHERE, WHAT is doing WRONG? I was exeprcting
> > to
> > get prompted with "1", but instead it is causing an error by returning
> > NULL?
>
> > Thanks a lot, Best, Hannes
>
> > THIS IS THE CALL FROM JS
>
> >        $('loadJson').addEvent('click', function(e) {
> >                e.stop();
> >                var jsonRequest = new Request.Json({
> >                    method: 'get',
> >                        url: 'http://www.whatever.com/JSONdeANDencode.php',
> >                        onComplete: function(realJson, stringJson){
> >                                alert(realJson.a);
> >                        }
> >               }).send("json="+Json.encode({'a': '1', 'b': '2'}));
> >        });
>
> > THIS IS THE JSONdeANDencode.php
>
> >        $arr = json_decode($_GET['json']);
> >        $json = json_encode($arr);
> >        print $json;

Reply via email to