Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Problems with Quotes (again)

    Quotes are haunting me again...

    Code:
    function post_something()
    {
    var obj = new Object();
    obj.item = "test";
    $.post('receiver.php', {data: $.toJSON(obj)}, done_func);
    }
    
    function done_func(res)
    {
    alert(res);
    }
    receiver.php...

    PHP Code:
    echo $_REQUEST['data'];
    return; 

    On my local server the alert shows... {"item ": "test"}
    On my host's server the alert shows... {\"item \": \"test\"}

    Feeding the 2nd value to var obj = $.evalJSON(res); doesn't work (unless, of course, I remove the slashes).

    In php.ini (locally, and remote)...
    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    magic_quotes_sybase = Off

    An explanation of what's going on would be very, very much appreciated.

  • #2
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I guess stripcslashes() works fine and good to have in there, anyway... I guess.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •