JSON Mootools Dizi sorun

0 Cevap php

I developed on localhost a system using mootools and Json I moved it to the production server and it doesn't work I've developed a really simple model and it produces null too:

    <script type="text/javascript" src="bookingSystem/mootools/mootoolsCore.js">
    </script>
    <script type="text/javascript" src="bookingSystem/mootools/mootoolsMore.js">
    </script>
    <script>
            function json(){
                var weekDays = JSON.encode({
                    apple: 'red',
                    lemon: 'yellow'
                });
                ;
                alert(weekDays);
                var request = new Request.JSON({
                    method: 'post',
                    url: 'jsonTest.php',
                    data: {
                    weeks: weekDays
                    },
                    onComplete: function(jsonObj){
                        alert("back");
                    }
                }).send();
            }

</script>


</head>
<body>
    <span onmousedown="json()">JSONTEST</span>
</body>
</html>

ve php

<?php
   var_dump(json_decode($_POST['weeks']));
 ?>

Bu NULL olarak çözer.

It worked perfectly with arrays on localhost but I can't get the array to work on my live server. If I don't use an array it works fine. Any ideas where I can start to look.

teşekkürler

0 Cevap