I have this simple function in javascript to refresh a page after a set time.
function AutoRefresh( t ) { setTimeout(\"location.reload(true);\", t); }
I'm afraid the answer is no. By the time JavaScript has been run on your page, the server side (PHP) has already finished processing. Your best bet is to accomplish what you need before the page load, or accomplish it with JavaScript alone.