Added code to php to handle the json request being made by angularjs.