This is an example of basic usage of calling Zend Controller with ajax/json and get response to the same phtml, so you can use it in your code.
In .phtml file I have javascript which call (in IndexController) the action ajaxAction():
<scriptlanguage="Javascript">var param1 ='first';//or get value from some DOM elementvar param2 ='second';//or get value from some DOM element
jQuery.ajax({
url:'/default/index/ajax',
type:'POST',
data:{param1: param1, param2:param2 },
dataType:"json",
success:function(result){var return1 = result.return1;var return2 = result.return2;// return1 and return2 is value from php file.// fill out DOM element or do the windows.location()}});</script>