Sample code :
jQuery(function() {
jQuery('#changePwYes').click(function(){
<?php
$this->session = new Zend_Session_Namespace(Zend_Registry::get('config')->session->nameSpace);
$this->session->showBox = "0";
?>
});
});
This php script should be executed only when button clicked but executing while loading itself.
What to do
In such case, when you want to make some changes on server side from client side without page redirection, we have AJAX.
Call a Zend controller action from your click event trough AJAX :
In your controller, create a new action :