pikemsu28 Posted February 6, 2007 Share Posted February 6, 2007 is there a simple script to automatically close a browser after so long. i've found scripts that close a popup but this isn't a popup i want to close. i have a task manager scheduled to load a php script that sends out an email and i want the browser to close without having to close the browser manually. thanks, Jason Link to comment https://forums.phpfreaks.com/topic/37356-solved-automatic-close-window/ Share on other sites More sharing options...
richardw Posted February 6, 2007 Share Posted February 6, 2007 Add this in the head tag... <META HTTP-EQUIV="Refresh" CONTENT="30;URL=javascript:self.close()"> Although this works, browsers may interpert this the wrong way and inform the user of an outside influence before colsing. Not recommended unless its a limited audience that you know. If you do use it, change the 30 which is this time in seconds. (not PHP, but javascript) Best Link to comment https://forums.phpfreaks.com/topic/37356-solved-automatic-close-window/#findComment-178646 Share on other sites More sharing options...
artacus Posted February 6, 2007 Share Posted February 6, 2007 I don't think its possible to close the browser. Only a popup window. Link to comment https://forums.phpfreaks.com/topic/37356-solved-automatic-close-window/#findComment-178683 Share on other sites More sharing options...
pikemsu28 Posted February 7, 2007 Author Share Posted February 7, 2007 i figured it out. i used this code: <script language="JavaScript"> <!-- function CloseWin(){ setTimeout("window.close()", 10000); } // --> </script> <body onload="window.opener='';CloseWin()"> can someone please close this thread! Link to comment https://forums.phpfreaks.com/topic/37356-solved-automatic-close-window/#findComment-179295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.