I'm trying the following code and my php returns null. What am I doing
wrong?
my JS:
var valsJSON = JSON.encode({min: '50', max: '200', betMin: '60',
betMax: '100'});
var getPayoff = new Request({
url: 'bet.php?json=',
method: 'get',
onSuccess: function(response){
//$('payoff').set('html', response);
alert(response);
},
onFailure: function(){
$('payoff').set('html', 'fail');
}
});
getPayoff.send(valsJSON);
my PHP:
<?php
$json_data = $_GET["json"];
// another post said the following string_repace might solve but
instead it causes the entire script to fail
//string_replace('\"', '"', $json_data);
var_dump(json_decode($json_data));
?>