If you are refreshing the page, you're effectively reloading it from the server, so any 'onload' events will fire again. The page will render again from scratch. You can call a PHP script using AJAX in some 'onload' Javascript listener if you like, though. e.g. with JQuery:
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready( function () {
setTimeout("location.reload(true);", 2000);
$.get('home.html', function(ret){
$('body').html(ret);
});
});
</script>
</head>
<body>
<h1>Test</h1>
</body>
</html>
Beware of calling setTimeout() recursively though as it can make a page unresponsive over time. You may find this useful:
http://www.erichynds.com/javascript/a-recursive-settimeout-pattern/