In this case you can use Ajax requests , I believe that would be the only option for you. To make the work easier, use the jQuery library. Assuming you've already included the library on your page, here are some examples:
To execute an external PHP code:
$.get( "test.php" );
If you need to pass some parameter to the script:
$.get( "test.php", { name: "John", time: "2pm" } );
If you need to get some feedback:
$.get( "test.php", function( data ) {
alert( "Retorno: " + data );
});
jQuery.get () or $. get () is equivalent to jQuery.ajax () or $ ajax () in terms of operation, however, would be "but" simple to use. Documentation: link
In addition to $. get () you can choose $ ajax () as listed above if you need more resources. Documentation: link