PHP scripts with AJAX

Updated PHP script to encode array as JSON to allow javascript to
receive multiple values one for average rating one for total rating
count.