hanhao Posted June 4, 2006 Share Posted June 4, 2006 ok i need to self close a window (like after 5 seconds)anyone knows the command to close the window?would[code=php:0]echo "self.close()"; [/code] ?be correct?if not, please tell me what i have left out with a counter example- hanhao Link to comment https://forums.phpfreaks.com/topic/11144-closing-the-current-window/ Share on other sites More sharing options...
wildteen88 Posted June 4, 2006 Share Posted June 4, 2006 You can only close a window with javascript so you'll want to use this:[code]echo "<script type=\"text/javascript\">window.close();</script>";[/code] Link to comment https://forums.phpfreaks.com/topic/11144-closing-the-current-window/#findComment-41660 Share on other sites More sharing options...
poirot Posted June 4, 2006 Share Posted June 4, 2006 If you need to close it after 5 seconds, you can use setTimeout()[code]<script type="text/javascript"> setTimeout("window.close()" , 5000);</script>[/code] Link to comment https://forums.phpfreaks.com/topic/11144-closing-the-current-window/#findComment-41726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.