If you are trying to update the count on the iframe load, then you can use the onload property of the iframe tag. And the update you can use by the ajax call or by the Html HttpRequest .
this can be done as like below
<iframe id="ifrme" src="demo.html" onload="doSomething()"></iframe>
And now the ajax call to invoke the php script.
<script type="text/javascript">
$(document).ready(function(){
function doSomething(){
$.ajax(
{ url: 'your_update_url.php?uid=123',
type : 'GET',
dataType: 'json',
success : function ( jsXHR) {
},
failed : function(status,data){ }
}
);
}
});
</script>
by this way you can invoke the script. For more info please check for ajax call using php