Php关闭窗口x经过一段时间后

I'm running apache, php, mysql on windows 7. I'm using windows task schedule to open a 'cron job' (php script) on my localhost server. In php I would like to close that tab in the window after 30 minutes (to ensure the script has operated). I know how to do it in javascript using setTimeout() and window.close() functions, but I'm avoiding javascript in this code. Is there a way to do it in php? Or if anyone knows how to do it in windows task scheduler, that would be good too.

Anytime I searched for it on google, all that popped up was the javascript way of closing a window.

If You don't need to see what You page displays, instead of using web browser, use some non-interactive tool that fetches websites, like wget or cURL. Both of them should be available as executable windows binaries. This will keep same behaviour for PHP script like normal webbrowser visit, except javascript which, you mentioned, wish to avoid, and will be not executed. Wget or cURL will only fetch content of generated page.

Wget - http://gnuwin32.sourceforge.net/packages/wget.htm

cURL - http://curl.haxx.se/download.html (on the bottom of page You have several version of cURL for windows).

The following code would open the IE browser with the URL mentioned ($url) and in the sleep parameters pass the time upto which you want the window to remain opened (parameter is in seconds).

//The code starts from here:
$browser = new COM("InternetExplorer.Application");
$handle = $browser -> HWND;
$browser -> Visible = true;
$browser -> Width = 1100;
$browser -> Height = 700;
//$url=your url you want to open
print_r($browser -> Navigate($url));
while ($browser -> Busy) 
{
      com_message_pump(5000);
}
//The time you think is sufficient to open your web page
sleep(10);
$browser -> Quit();