Success answer : Success : Your rate has been recorded. Thanks for your rate :)
';
$aResponse['server'] .= 'Rate received : '.$rate.'
';
$aResponse['server'] .= 'ID to update : '.$id;
// END ONLY FOR DEMO
echo json_encode($aResponse);
}
else
{
$aResponse['error'] = true;
$aResponse['message'] = 'An error occured during the request. Please retry';
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
$aResponse['server'] = 'ERROR : Your error if the request crash !';
// END ONLY FOR DEMO
echo json_encode($aResponse);
}
}
else
{
$aResponse['error'] = true;
$aResponse['message'] = '"action" post data not equal to \'rating\'';
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
$aResponse['server'] = 'ERROR : "action" post data not equal to \'rating\'';
// END ONLY FOR DEMO
echo json_encode($aResponse);
}
}
else
{
$aResponse['error'] = true;
$aResponse['message'] = '$_POST[\'action\'] not found';
// ONLY FOR THE DEMO, YOU CAN REMOVE THE CODE UNDER
$aResponse['server'] = 'ERROR : $_POST[\'action\'] not found';
// END ONLY FOR DEMO
echo json_encode($aResponse);
}